Copyright: Copyright © 1995 by TurboPower Software Co.
Citation: All Rights Reserved


Array Editor Components

TOvcSimpleArrayEditor

TOvcPictureArrayEditor

TOvcNumericArrayEditor


Command Processor Table Editor

Nearly all operations supported by the TOvcCommandProcessor are accessible through the Command Table Editor. It is made available to the Orpheus components through the EntryCommands property of the TOvcController component.

Assigned keys

This listbox displays the currently assigned key sequences. Selecting one of the key sequences in this listbox also selects the command that is assigned to the key sequence in the Commands listbox.

Commands

This listbox displays all available commands. Note that not all commands are handled by each Orpheus component.

Active

This checkbox indicates if the command table is active or not. If this checkbox is checked, then the command processor's Translate method will scan this table when called.

First key and Second key

These special edit components display the key name of the key or keys that are pressed rather than the actual character. For example, if you hold the control key and press F1, 'Ctrl+F1' is displayed.

WordStar 2-Key Command

This checkbox indicates that the entered key sequence should be treated as a WordStar-style command. A WordStar key sequence has two parts. The first part is usually something like <CtrlQ> and the second is a single letter or number. When a WordStar-style key sequence is entered by the user, the control key can be used with the first part only or with both parts. For example, <CtrlQ><A> and <CtrlQ><CtrlA> are both acceptable.

If you check this box and the entered keys are not an appropriate WordStar-style key sequence, an error is generated and the checkbox is cleared.

Assign

This button maps (or assigns) the key sequence entered in the 'First key' and 'Second key' edit fields to the selected command in the 'Commands' listbox.

Clear

This button clears (or deletes) an existing command-key mapping from the command table. The selected key sequence in the 'Assigned keys' listbox is removed from the table.

User Cmd

This button assigns the key sequence entered in the 'First key' and 'Second key' edit fields as a user-defined command. User-defined commands allow you to provide special actions when the key sequence is entered by the user. User-defined commands are available for those Orpheus components that publish an OnUserCommand event (for example, the Orpheus entry fields).

When you press 'User Cmd', the next available user-defined command is assigned and displayed in the 'Commands' listbox. Valid user-defined commands are ccUserFirst to ccUser65535-ccUserFirst. ccUserFirst is defined in the OvcConst unit.

Help

This button displays help text for the Command Table Editor.

Close

This button exits and closes the form. Changes made to the command tables are immediately transferred to the project form. Using this button or closing the form using the system menu will not undo any changes that were made previously. If you need to "undo" changes, close the current project without saving.

Default, WordStar, and Grid Tabs

These tabs are used to select a command table to view or modify.

Command Table Editor Menu Options

The only item in the Command Table Editor menu is Table. It gives you access to a group of operations involving command tables.

New

This menu option creates a new (empty) command table using 'NewTable' for the name. A number is appended to the end of the name if another table with the same name already exists. Use Rename to change the name of the command table.

Delete

This menu option deletes the current command table (the selected tab) from the command processor's internal list of command tables. You are asked for confirmation before the command table is deleted.

Caution: there is no "undo" for this operation.

Duplicate

This menu option creates a new command table (as described in Table|New). It then copies all existing command-key mappings from the current command table (the selected tab) to the new command table.

Load

This menu option allows you to load a previously stored command table from a file. If a table with the same name already exists, the loaded table name is changed by appending a number to it.

Save

This menu option writes the current command table (the selected tab) to a file.

Order

This menu option displays the 'Change Scan Order' form.

Rename

Enter the new name for the current command table (the selected tab) and press OK to change the name, or press Cancel to exit without changing the name.


Components

Entry Field Components

Data Aware Components

Array Editor Components

Table Components

Text Editor Components

Viewer Components

Spinner Components

Misc Components


Contents
Orpheus

Table of Contents

Orpheus is a collection of native Visual Component Library (VCL) components that extend the user interface design capabilities of Borland Delphi. It allows you to use optimized VCL components that are fully integrated with Delphi, compile directly into your EXE files, and include complete source code. The Orpheus visual component library provides a wide range of components:

 Components

 Date and Time Routines

 Exceptions

 Technical Support


Data Aware Components

TOvcDbSimpleField

TOvcDbPictureField

TOvcDbNumericField

TOvcDbEditor


Date and Time Routines

The OvcDT unit provides routines that allow you to store dates and times in compact formats, to convert them to other forms, and to perform date and time arithmetic.

The term "Julian date" means different things to different people. Among astronomers and historians, it has a very precise and technical meaning. Among programmers, however, the term has acquired a much broader meaning, something like "a date stored as an integer value representing the serial number of days from a given point in time." And it is in that widely understood sense that the term is used here.

Orpheus defines date and time data types:

TOvcDate = LongInt;

TOvcTime = LongInt;

Dates are stored in long integer format as the number of days since January 1, 1600. Times are represented as the number of seconds since midnight.

When one of the OvcDT routines needs to return an error to indicate an invalid date or time, invalid date values are represented by BadDate and invalid time values are represented by BadTime.

The following lists the procedures and functions provided by the OvcDT unit.

CurrentDate

CurrentTime

DateTimeToOvcDate

DateTimeToOvcTime

DateToDMY

DayOfWeek

DayOfWeekDMY

DaysInMonth

DecTime

DMYToDate

HMSToTime

IncDate

IncDateTrunc

IncTime

IsLeapYear

OvcDateToDateTime

OvcTimeToDateTime

TimeToHMS

ValidDate

ValidTime


Entry Field Components

TOvcSimpleField

TOvcPictureField

TOvcNumericField


Exceptions
Orpheus Exception Classes

The OvcExcpt unit interfaces exception classes that are used by the Orpheus components. These topics describe all OvcExcpt exception classes. Exceptions are used in Orpheus wherever they simplify the source code or enhance the error handling capability of a component or class. Standard Delphi exceptions, such as those relating to file input and output, are used whenever appropriate.

One case in which exceptions are not used is for validation errors in entry fields. Instead, an error handling event is called to handle the error. This is because the actual error can be generated outside the Orpheus component. For example, entry fields allow you to perform additional validation and report errors that are unknown to Orpheus. If an exception is raised in the OnError event handler, the form sees the exception, but the entry field does not. Because of this, and to provide a flexible error handling mechanism, exceptions are not used for validation errors.

Standard Delphi exceptions are used whenever applicable. Orpheus exceptions are used only for conditions that are unique to Orpheus components.

For details on individual Orpheus Exception Classes, refer to the Exception Hierarchy diagram.


Misc Components

TOvcController

TOvcNotebook

TOvcCalendar

TOvcMeter

TOvcRotatedLabel

TOvcTimerPool

TOvcTransfer


Notebook Page Property Editor

This property editor provides access to the page name, enabled status, hint text, and help context. You can add, delete, and edit these properties by selecting the appropriate button at the right of the form.

The arrow buttons are used to change the order of the notebook pages. Clicking the up button moves the selected page one position up in the order, and clicking the down button moves the selected page one position down.

Selecting either the Add or Edit button displays the following form:

Enter or change the notebook page information as needed. 'Tab Name' is the text that is displayed on the notebook tab, 'Hint' is the text stored in the page's Hint property, 'Help Context' is the value that is stored in the page's HelpContext property, and 'Page Enable' determines if the notebook page is selectable at run-time.


Numeric Field Mask Property Editor

This property editor allows entry of a picture mask string and/or selection of one of the sample picture masks from the list.

Possible values for the characters in the picture mask string are:

pmPositive    = '9';   {allows numbers and spaces only}

pmWhole       = 'i';   {allows numbers, spaces, minus}

pmDecimal     = '#';   {allows numbers, spaces, minus, period}

pmHexadecimal = 'K';   {allows 0-9 and A-F, forces upper case}

pmBinary      = 'b';   {allows 0-1, space}

The value assigned to PictureMask is not tested for validity. It is possible to assign a mask that is invalid.


OvcCmd.TOvcCmdRec
TOvcCmdRec type

TOvcCmdRec has the following format:

TOvcCmdRec = record

  case Byte of

    0 : (Key1  : Byte;     {virtual key code}

         SS1   : Byte;     {shift state of first key}

         Key2  : Byte;     {second virtual key code, if any}

         SS2   : Byte;     {shift state of second key}

         Cmd   : Word);    {assigned command}

    1 : (Keys  : LongInt);

end;


OvcDT.CurrentDate
CurrentDate function

function CurrentDate : TOvcDate;

CurrentDate returns today's date as a Julian date.

This routine calls Windows to determine the current date, then converts the returned values (day, month, and year) to a TOvcDate variable, which is returned as the function result.

See also: CurrentTime


OvcDT.CurrentTime
CurrentTime function

function CurrentTime : TOvcTime;

CurrentTime returns the current time in seconds since midnight.

This routine calls Windows to determine the current time of day, then converts the values it returns (hours, minutes, and seconds) to a TOvcTime variable, which is returned as the function result.

The following example calculates the number of seconds that elapsed between two events happening within the same day.

var

  Start, Elapsed : TOvcTime;

...

Start := CurrentTime;

...

Elapsed := CurrentTime - Start;

See also: CurrentDate


OvcDT.DMYToDate
DMYToDate function

function DMYToDate(Day, Month, Year : Integer) : TOvcDate;

DMYToDate converts from day, month, year to a Julian date.

If the date is invalid, BadDate is returned. If Year is less than 100, it is assumed to be relative to 1900.

The following example sets DateToRemember equal to the number of days between January 1, 1600 and November 13, 1987.

DateToRemember := DMYToDate(13, 11, 1987);

See also: DateToDMY


OvcDT.DateTimeToOvcDate
DateTimeToOvcDate function

function DateTimeToOvcDate(DT : TDateTime) : TOvcDate;

DateTimeToOvcDate converts a Delphi date to an Orpheus date.

This routine extracts the date portion (the whole number part) from a Delphi TDateTime value and converts it into an Orpheus TOvcDate value, which is returned as the function result.

See also: OvcDateToDateTime, DateTimeToOvcTime


OvcDT.DateTimeToOvcTime
DateTimeToOvcTime function

function DateTimeToOvcTime(DT : TDateTime) : TOvcTime;

DateTimeToOvcTime converts a Delphi time to an Orpheus time.

This routine extracts the time portion (the decimal part) from a Delphi TDateTime value and converts it into an Orpheus TOvcTime value, which is returned as the function result.

See also: OvcTimeToDateTime, DateTimeToOvcDate


OvcDT.DateToDMY
DateToDMY procedure

procedure DateToDMY(Julian : TOvcDate; var Day, Month, Year : Integer);

DateToDMY converts a Julian date to day, month, year.

If Julian equals BadDate, then Day, Month, and Year are all set to 0.

The following example sets Day, Month, and Year to today's date.

DateToDMY(CurrentDate, Day, Month, Year);

See also: CurrentDate, DMYToDate


OvcDT.DayOfWeek
DayOfWeek function

function DayOfWeek(Julian : TOvcDate) : TDayType;

DayOfWeek returns the day of the week for a Julian date.

If Julian is not a valid date, DayOfWeek returns an invalid ordinal value of 7 which causes a range exception (if range checking is turned on) when used.

The following example obtains a string representing the current day of the week. Since TDayType is an enumerated data type, the first element (Sunday) has an ordinal value of 0. Adding 1 to this value yields the correct index into Delphi's array of day names which starts at 1.

S := LongDayNames[Ord(DayOfWeek(CurrentDate))+1];

See also: CurrentDate, DayOfWeekDMY


OvcDT.DayOfWeekDMY
DayOfWeekDMY function

function DayOfWeekDMY(Day, Month, Year : Integer) : TDayType;

DayOfWeekDMY returns the day of the week for the day, month, and year.

If the date represented by Day, Month, and Year is not valid, DayOfWeekDMY returns an invalid ordinal value of 7 which causes a range exception (if range checking is turned on) when used.

The following example returns Friday (ordinal value 5).

DOW := DayOfWeekDMY(13, 11, 1987);

See also: DayOfWeek


OvcDT.DaysInMonth
DaysInMonth function

function DaysInMonth(Month, Year : Integer) : Integer;

DaysInMonth returns the number of days in the specified month and year.

The following example returns 29, since 1992 is a leap year.

Days := DaysInMonth(2, 1992);


OvcDT.DecTime
DecTime function

function DecTime(T : TOvcTime; Hours, Minutes, Seconds : Byte) : TOvcTime;

DecTime subtracts the specified hours, minutes, and seconds from the specified time of day.

The result of DecTime is adjusted to account for the rollover at midnight.

The following example sets HourAgo equal to 01:00:00 am and ThreeHoursAgo to 11:00:00 pm (note the rollover).

RightNow := HMSToTime(2, 0, 0); {02:00:00 am}

HourAgo := DecTime(RightNow, 1, 0, 0);

ThreeHoursAgo := DecTime(RightNow, 3, 0, 0);

See also: HMSToTime, IncTime


OvcDT.HMSToTime
HMSToTime function

function HMSToTime(Hours, Minutes, Seconds : Byte) : TOvcTime;

HMSToTime converts from hours, minutes, seconds to an Orpheus time value.

Given a time of day in Hours, Minutes, and Seconds, this routine returns the time in seconds since midnight. Hours is in 24-hour format. If the time is invalid, BadTime is returned.

See also: TimeToHMS


OvcDT.IncDate
IncDate function

function IncDate(Julian : TOvcDate; Days, Months, Years : Integer) : TOvcDate;

IncDate adjusts a Julian date by the specified number of days, months, and years.

IncDate adds (or subtracts) the specified number of Days, Months, and Years to (or from) a date. Months and Years are added before Days, and no overflow or underflow checks are made.

The following example demonstrates one tricky case involving IncDate, the case where Julian represents a date at the end of a month and the addition of one or more months can result in a day of the month that doesn't exist in the new month. The result "should" be 02/29/1993, but that date doesn't exist. So what you get is a seemingly illogical result that is consistent with IncDate's simplistic philosophy of date arithmetic: 03/01/1993. That is, the value in D2 would represent 02/29/1993 if there was such a date, but because February has only 28 days in that year, the result is (02/28/1993)+1, or 03/01/1993. If this behavior is unacceptable for your application, use IncDateTrunc instead.

D1 := DMYToDate(29, 1, 1993); {01/29/1993}

D2 := IncDate(D1, 0, 1, 0);

See also: DMYToDate, IncDateTrunc


OvcDT.IncDateTrunc
IncDateTrunc function

function IncDateTrunc(Julian : TOvcDate; Months, Years : Integer) : TOvcDate;

IncDateTrunc adjusts a Julian date by the specified number of months and years.

IncDateTrunc adds (or subtracts) the specified number of months and years to (or from) a date. This routine is essentially the same as IncDate, but with two important differences. First, it takes no Days parameter, just Months and Years. And second, it "truncates" the day of the month in cases where the addition of Months results in an invalid date.

The following example demonstrates what is meant by "truncates." Because 02/29/1993 does not exist, D2 is set to 03/01/1993 and D3 is set to 02/28/93.

D1 := DMYToDate(29, 1, 1993); {01/29/1993}

D2 := IncDate(D1, 0, 1, 0);

D3 := IncDateTrunc(D1, 1, 0);

See also: DMYToDate, IncDate


OvcDT.IncTime
IncTime function

function IncTime(T : TOvcTime; Hours, Minutes, Seconds : Byte) : TOvcTime;

IncTime adds the specified hours, minutes, and seconds to the specified time of day.

The result of IncTime is adjusted to account for the rollover at midnight.

The following example sets HourFromNow equal to 11:00:00 pm and ThreeHoursFromNow to 1:00:00 am (note the rollover).

RightNow := HMSToTime(22, 0, 0); {10:00:00 pm}

HourFromNow := IncTime(RightNow, 1, 0, 0);

ThreeHoursFromNow := IncTime(RightNow, 3, 0, 0);

See also: DecTime, HMSToTime


OvcDT.IsLeapYear
IsLeapYear function

function IsLeapYear(Year : Integer) : Boolean;

IsLeapYear returns True if the specified year is a leap year.

Year is assumed to be in the range 1600 to 3999 and no error checking is done.


OvcDT.OvcDateToDateTime
OvcDateToDateTime function

function OvcDateToDateTime(D : TOvcDate) : TDateTime;

OvcDateToDateTime converts an Orpheus date to a Delphi date/time.

This routine converts an Orpheus TOvcDate value to a Delphi TDateTime value, which is returned as the function result. The time (decimal) part of the TDateTime value is set to 0. No validity checks are performed on the date specified by D.

See also: DateTimeToOvcDate, OvcTimeToDateTime


OvcDT.OvcTimeToDateTime
OvcTimeToDateTime function

function OvcTimeToDateTime(T : TOvcTime) : TDateTime;

OvcTimeToDateTime converts an Orpheus time to a Delphi date/time.

This routine converts an Orpheus TOvcTime value to a Delphi TDateTime value, which is returned as the function result. The date (whole) part of the TDateTime value is set to 0. No validity checks are performed on the time specified by T.

See also: DateTimeToOvcTime, OvcDateToDateTime


OvcDT.TDayType
TDayType type

TDayType = (Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday);


OvcDT.TimeToHMS
TimeToHMS procedure

procedure TimeToHMS(T : TOvcTime; var Hours, Minutes, Seconds : Byte);

TimeToHMS converts an Orpheus time variable to hours, minutes, seconds.

If T equals BadTime, then Hours, Minutes, and Seconds are all set to 0.

The following example sets Hours, Minutes, and Seconds to the current time.

TimeToHMS(CurrentTime, Hours, Minutes, Seconds);

See also: HMSToTime


OvcDT.ValidDate
ValidDate function

function ValidDate(Day, Month, Year : Integer) : Boolean;

ValidDate verifies that the specified day, month, and year is a valid date.

ValidDate returns True if the date specified by Day, Month, and Year is valid and False if it isn't. If Year is less than 100, it is assumed to be relative to 1900. If Year is not less than 100, it must be in the range 1600-3999.


OvcDT.ValidTime
ValidTime function

function ValidTime(Hours, Minutes, Seconds : Integer) : Boolean;

ValidTime verifies that the specified hours, minutes, and seconds represent a valid time.

ValidTime returns True if the time specified by Hours, Minutes, and Seconds is valid and False if it isn't.


OvcData.BadDate
BadDate constant

BadDate = -1;

This value is used to represent an invalid date, such as 13/13/1995.


OvcData.BadTime
BadTime constant

BadTime = -1;

This value is used to represent an invalid time of day, such as 12:61:00.


OvcData.TRangeType
TRangeType type

Each entry field maintains two data structures of this type, one to store the lower limit of a field's value, and another to store the upper limit.

  TRangeType = record

    case Byte of                         {size}

    00 : (rtChar : Char);                 {01}

    01 : (rtByte : Byte);                 {01}

    02 : (rtSht  : ShortInt);             {01}

    03 : (rtInt  : Integer);              {02}

    04 : (rtWord : Word);                 {02}

    05 : (rtLong : LongInt);              {04}

    06 : (rtSgl  : Single);               {04}

    07 : (rtPtr  : Pointer);              {04}

    08 : (rtReal : Real);                 {06}

    09 : (rtDbl  : Double);               {08}

    10 : (rtComp : Comp);                 {08}

    11 : (rtExt  : Extended);             {10}

    12 : (rtDate : LongInt);              {04}

    13 : (rtTime : LongInt);              {04}

    14 : (rt10   : array[1..10] of Byte); {10} {forces structure to size of 10 bytes}

  end;


OvcExcpt hierarchy


OvcExcpt.ECmdProcessorError
ECmdProcessorError

ECmdProcessorError = class(EOvcException)

Base exception class for the TOvcCommandProcessor class. The only error conditions that are raised using this base class are ones that are generated at design time.


OvcExcpt.EControllerError
EControllerError

EControllerError = class(EOvcException)

Base exception class for the TOvcController component. The only error conditions that are raised using this base class are ones that are generated at design time.


OvcExcpt.EDuplicateCommand
EDuplicateCommand

EDuplicateCommand = class(ECmdProcessorError)

Raised when you attempt to add a command key assignment that already exists in the command table. The same command can be assigned to different key sequences, but the same key sequence cannot be assigned to more than one command within the same command table.


OvcExcpt.EEditorError
EEditorError

EEditorError = class(EOvcException)

Base exception class for the TOvcEditor and TOvcTextFileEditor components. See the OnError event help for a list of the error conditions that cause this exception to be raised.


OvcExcpt.EEntryFieldError
EEntryFieldError

EEntryFieldError = class(EOvcException)

Base exception class for the entry field components. See the TOvcBaseEntryField OnError event for a list of the error conditions that cause this exception to be raised.


OvcExcpt.EFixedFontError
EFixedFontError

EFixedFontError = class(EOvcException)

Base exception class for the TOvcFixedFont class. The only error conditions that are raised using this base class are ones that are generated at design time.


OvcExcpt.EInvalidDataType
EInvalidDataType

EInvalidDataType = class(EEntryFieldError)

The attempted operation is inappropriate for the current field type and option settings. For example, an attempt was made to use the AsBoolean property to obtain the value of an entry field that has a string data type.


OvcExcpt.EInvalidFixedFont
EInvalidFixedFont

EInvalidFixedFont = class(EFixedFontError)

Raised when you attempt to assign a font that is not fixed-pitch to an instance of a TOvcFixedFont. The font assigned to a TOvcFixedFont object must have a fixed pitch.


OvcExcpt.EInvalidFontParam
EInvalidFontParam

EInvalidFontParam = class(EFixedFontError)

Raised when you attempt to assign a class other than a TFont or a TOvcFixedFont using the TOvcFixedFont's Assign method.


OvcExcpt.EInvalidLabelFont
EInvalidLabelFont

EInvalidLabelFont = class(ERotatedLabelError)

An attempt was made to assign a font that is not a TrueType font when the rotated label's Angle property is not zero. Rotated label components with Angle property values other than zero require a TrueType font.


OvcExcpt.EInvalidLineOrCol
EInvalidLineOrCol

EInvalidLineOrCol = class(EEditorError)

The specified line or column is not within the valid range. Valid line numbers are 1 through the number of lines currently in the editor's text stream. Valid column numbers are 1 through the length of the specified line.


OvcExcpt.EInvalidLineOrPara
EInvalidLineOrPara

EInvalidLineOrPara = class(EEditorError)

The specified line or paragraph is not within the valid range. Valid line numbers are 1 through the number of lines currently in the editor's text stream. Valid paragraph numbers are 1 through the number of paragraphs currently in the editor's text stream.


OvcExcpt.EInvalidPageIndex
EInvalidPageIndex

EInvalidPageIndex = class(ENotebookError)

The index points to a notebook page that does not exist or it is disabled or hidden. The valid range for index values is 0 to the number of notebook pages - 1.


OvcExcpt.EInvalidPictureMask
EInvalidPictureMask

EInvalidPictureMask = class(EEntryFieldError)

An attempt was made to assign an invalid character or string as the field's picture mask.


OvcExcpt.EInvalidRangeValue
EInvalidRangeValue

EInvalidRangeValue = class(EEntryFieldError)

Generated when you assign a range value that is outside the valid range.


OvcExcpt.EInvalidTabFont
EInvalidTabFont

EInvalidTabFont = class(ENotebookError)

When right-side tabs are used, the notebook's font must be a TrueType font. That is because the font used must be rotated 90 degrees for right-side tabs, and that can only be done with TrueType fonts.


OvcExcpt.EInvalidTriggerHandle
EInvalidTriggerHandle

EInvalidTriggerHandle = class(ETimerPoolError)

An attempt was made to reference a trigger handle that is invalid.


OvcExcpt.ENoControllerAssigned
ENoControllerAssigned

ENoControllerAssigned = class(EControllerError)

Raised during component creation if a TOvcController component is not assigned to the component's Controller property. Components that publish a Controller property must have a TOvcController component assigned within the same command table.


OvcExcpt.ENoTimersAvail
ENoTimersAvail

ENoTimersAvail = class(ETimerPoolError)

The TOvcTimerPool component requested a Windows timer handle and none are available.


OvcExcpt.ENotebookError
ENotebookError

ENotebookError = class(EOvcException)

Base exception class for the TOvcNotebook component. The only error conditions that are raised using this base class are ones that are generated at design time.


OvcExcpt.EOnSelectNotAssigned
EOnSelectNotAssigned

EOnSelectNotAssigned = class(EVirtualListboxError)

Multiple selection is enabled, but the OnSelect event is not assigned. If the MultiSelect property is True, a method must be assigned to the OnSelect event to provide and store the selection status of all elements in the list.

This exception indicates a programming error and should not be caught in a try block since doing so would serve no purpose other than to hide the error. When this exception is raised, a message is displayed indicating that a method is not assigned to the OnSelect event.


OvcExcpt.EOvcException
EOvcException

EOvcException = class(Exception)

The base Orpheus exception class. All other Orpheus exception classes are derived from EOvcException.

This exception is raised for error conditions in the Orpheus property editors only. Errors specific to a particular component or class cause more specific exceptions.


OvcExcpt.ERegionTooLarge
ERegionTooLarge

ERegionTooLarge = class(EViewerError)

Text to be copied to the Windows clipboard is larger than 64KB.


OvcExcpt.ERotatedLabelError
ERotatedLabelError

ERotatedLabelError = class(EOvcException)

Base exception class for the TOvcRotatedLabel component. The only error conditions that are raised using this base class are ones that are generated at design time.


OvcExcpt.ESAEAtMaxSize
ESAEAtMaxSize

ESAEAtMaxSize = class(ESparseArrayError)

The sparse array is at its maximum size and no more elements can be added. The maximum size for a sparse array is 320,000 elements. This is defined as the MaxSparseArrayItems constant in the OvcSpAry unit.


OvcExcpt.ESAEOutOfBounds
ESAEOutOfBounds

ESAEOutOfBounds = class(ESparseArrayError)

The sparse array index is not in the valid range. The valid range for a sparse array index is 0 through the number of elements in the sparse array.


OvcExcpt.ESparseArrayError
ESparseArrayError

ESparseArrayError = class(EOvcException)

Base exception class for the TOvcSparseArray class. The only error conditions that are raised using this base class are ones that are generated at design time.


OvcExcpt.ETableError
ETableError

ETableError = class(EOvcException)

Base exception class for the TOvcTable component.


OvcExcpt.ETableNotFound
ETableNotFound

ETableNotFound = class(ECmdProcessorError)

The specified command table cannot be found in the internal command table list.


OvcExcpt.ETimerPoolError
ETimerPoolError

ETimerPoolError = class(EOvcException)

Base exception class for the TOvcTimerPool component. The only error conditions that are raised using this base class are ones that are generated at design time.


OvcExcpt.EViewerError
EViewerError

EViewerError = class(EOvcException)

Base exception class for the TOvcFileViewer and TOvcTextFileViewer components. The only error conditions that are raised using this base class are ones that are generated at design time.


OvcExcpt.EVirtualListBoxError
EVirtualListBoxError

EVirtualListboxError = class(EOvcException)

Base exception class for the TOvcVirtualListbox component. The only error conditions that are raised using this base class are ones that are generated at design time.


OvcTable.TColNum
TColNum type

TColNum = Integer;


OvcTable.TRowNum
TRowNum type

TRowNum = LongInt;


Picture Field Mask Property Editor

This property editor allows entry of a picture mask string and/or selection of one of the sample picture masks from the list.

Possible values for the characters in the picture mask string are:

pmAnyChar     = 'X';   {allows any character}

pmForceUpper  = '!';   {allows any character, forces upper case}

pmForceLower  = 'L';   {allows any character, forces lower case}

pmForceMixed  = 'x';   {allows any character, forces mixed case}

pmAlpha       = 'a';   {allows alphas only}

pmUpperAlpha  = 'A';   {allows alphas only, forces upper case}

pmLowerAlpha  = 'l';   {allows alphas only, forces lower case}

pmPositive    = '9';   {allows numbers and spaces only}

pmWhole       = 'i';   {allows numbers, spaces, minus}

pmDecimal     = '#';   {allows numbers, spaces, minus, period}

pmScientific  = 'E';   {allows numbers, spaces, minus, period, 'e'}

pmHexadecimal = 'K';   {allows 0-9 and A-F, forces upper case}

pmBinary      = 'b';   {allows 0-1, space}

pmTrueFalse   = 'B';   {allows T, t, F, f}

pmYesNo       = 'Y';   {allows Y, y, N, n}

The value assigned to PictureMask is not tested for validity. It is possible to assign a mask that is invalid.


Range Property Editor

This property editor allows entering of a low or high range value specific to the component and its current data type.

If the component supports a picture mask, the value entered must conform to the requirements of the mask. For example, if you are setting the range for a date field and the PictureMask property is "dd/mm/yy", you would enter a range value with the day specified first, followed by the month, and finally, the year ("13/11/87").


Simple Field Mask Property Editor

The possible vlaues accepted as picture mask characters are shown below:

pmAnyChar     = 'X';   {allows any character}

pmForceUpper  = '!';   {allows any character, forces upper case}

pmForceLower  = 'L';   {allows any character, forces lower case}

pmForceMixed  = 'x';   {allows any character, forces mixed case}

pmAlpha       = 'a';   {allows alphas only}

pmUpperAlpha  = 'A';   {allows alphas only, forces upper case}

pmLowerAlpha  = 'l';   {allows alphas only, forces lower case}

pmPositive    = '9';   {allows numbers and spaces only}

pmWhole       = 'i';   {allows numbers, spaces, minus}

pmDecimal     = '#';   {allows numbers, spaces, minus, period}

pmScientific  = 'E';   {allows numbers, spaces, minus, period, 'e'}

pmHexadecimal = 'K';   {allows 0-9 and A-F, forces upper case}

pmBinary      = 'b';   {allows 0-1, space}

pmTrueFalse   = 'B';   {allows T, t, F, f}

pmYesNo       = 'Y';   {allows Y, y, N, n}

The value assigned to PictureMask is tested only against the list shown above. It is still possible to assign a character that is inappropriate because of the field's data type. For example, if the field has a data type of sftReal, setting the PictureMask property to 'A' is allowed but is invalid because it allows only alphabetic characters.


Spinner Components

TOvcSpinner

TOvcFourWaySpinner

TOvcStarSpinner


TOVCTCComboBox.Sorted
Sorted property

property TOvcTCComboBox.Sorted : boolean

Default: True

Sorted indicates whether the pre-set strings are sorted

This is the same property as the TComboBox component's Sorted property in Delphi.


TOvcBase
TOvcBase class

See also: properties, events, methods, hierarchy

Class Overview

TOvcBase serves as a common base class for all of the Orpheus components. Its primary purpose is to provide a Controller property for all of its descendants.

During the creation of any descendant of the TOvcBase class, the parent form is searched for the existence of a TOvcController component. If one is found, it is assigned as the controller for this component. If no TOvcController component is found, one is created and is then assigned as the controller for this component.


TOvcBase hierarchy


TOvcBase.Controller
Controller property

property TOvcBase.Controller : TOvcController

Default: the first TOvcController object on the form.

Controller is the TOvcController object that is attached to this component.

If this property is not assigned, some or all of the features provided by the component will not be available. The Controller property is not published, but descendants can publish it as needed (as most of the Orpheus components do).


TOvcBase.events
TOvcBase events

OnClick 	OnKeyDown

OnDblClick 	OnKeyPress

OnDragDrop 	OnKeyUp

OnDragOver 	OnMouseDown

OnEndDrag 	OnMouseMove

OnEnter 	OnMouseUp

OnExit


TOvcBase.methods
TOvcBase methods

AlignControls 	HasParent

Assign	Hide

AssignTo 	InheritsFrom

BeginDrag	InitInstance

BringToFront	InsertComponent

Broadcast	InsertControl

CanFocus	InstanceSize

ChangeName 	Invalidate

ChangeScale 	IsControlMouseMsg

ClassInfo	KeyDown

ClassName	KeyPress

ClassParent	KeyUp

ClassType	Loaded

Click 	MainWndProc

ClientToScreen	MethodAddress

ContainsControl	MethodName

ControlAtPos	MouseDown

Create	MouseMove

CreateHandle 	MouseUp

CreateParams 	NewInstance

CreateSubClass 	NotifyControls

CreateWindowHandle 	Paint

DblClick 	PaintControls

DefaultHandler 	PaintHandler

DefineProperties 	PaintWindow

Destroy	PaletteChanged

DestroyComponents	Perform

DestroyHandle 	ReadState

Destroying	Realign

DestroyWindowHandle 	RecreateWnd

DestroyWnd 	Refresh

DisableAlign	RemoveComponent

Dispatch	RemoveControl

DoEnter 	Repaint

DoExit 	ScaleBy

DoKeyDown 	ScaleControls

DoKeyPress 	ScreenToClient

DoKeyUp 	ScrollBy

DragCanceled 	SelectFirst

Dragging	SelectNext

EnableAlign	SendToBack

EndDrag	SetBounds

FieldAddress	SetDesigning

FindComponent	SetFocus

FindNextControl 	SetName

Focused	SetParent

Free	SetTextBuf

FreeInstance	SetZOrder

GetClientOrigin 	Show

GetClientRect 	ShowControl

GetDeviceContext 	Update

GetPalette 	UpdateBoundsRect

GetTabOrderList	ValidateRename

GetTextBuf	VisibleChanging

GetTextLen	WndProc

HandleAllocated	WriteComponents

HandleNeeded	WriteState


TOvcBase.properties
TOvcBase properties

Align 	Handle

BoundsRect 	Height

Brush 	HelpContext

Canvas  	Hint

Caption  	IsControl

ClientHeight 	Left

ClientOrigin 	MouseCapture

ClientRect 	Name

ClientWidth 	Owner

Color  	Parent

ComponentCount 	ParentColor

ComponentIndex 	ParentCtl3D

Components 	ParentFont

ComponentState 	ParentShowHint

ControlCount 	PopupMenu

Controller  	ShowHint

Controls 	Showing

ControlState 	TabOrder

ControlStyle 	TabStop

Ctl3D  	Tag

Cursor	Text

DefWndProc  	Top

DesignInfo 	Visible

DragCursor  	Width

DragMode  	WindowHandle

Enabled

Font


TOvcBaseArrayEditor
TOvcBaseArrayEditor class

See also: properties, events, methods, hierarchy

Class Overview

The TOvcBaseArrayEditor class is the immediate ancestor of the three array editor components. It provides methods and properties common to all array editors.

The Orpheus array editors allow editing of array-like structures in what looks like a listbox containing editable cells. In fact, the array editors are very similar to the TOvcVirtualListbox component. They allow you to edit the active list item just as you edit the simple, picture, or numeric entry fields.

The array editors consist of a base class and three components that are derived from it:

•  TOvcBaseArrayEditor class

•  TOvcSimpleArrayEditor component

•  TOvcPictureArrayEditor component

•  TOvcNumericArrayEditor component

The three classes of array editors get their in-place editing capabilities from the corresponding entry field components. Any standard Pascal data type that can be stored in an array or viewed as an array-like structure (database files, linked lists, etc.) can be edited using the array editors. You can even edit data structures that contain dates and times.

The Orpheus array editors get their data by calling an event handler (OnGetItem) that you provide. Actually, the array editor obtains a pointer to the data and uses the pointer to update the listbox display and the data itself when it is edited. The array editors do not store a copy of the data. Because of this, there are essentially no capacity limitations imposed by the array editors. The only limit is imposed by the index, which is a long integer. This means that the maximum number of items that can be managed by an array editor is slightly over 2 billion.

When the array editor needs to paint a row, it calls the method assigned to the OnGetItem event to get the address of the data. If the cell is modified, this address is used to store the new value just before the focus leaves the edit cell.

After you drop an array editor on your form, you must perform the following steps before the array editor can be used:

1. Set the DataType property to match the type of data in your data structure.

2. Set the NumItems property to reflect the number of elements in your data structure.

3. Assign a method to the OnGetItem event that returns the address of the requested array element.

The address returned by your method must point to a value that has the same data type as the DataType property!

When your program changes a value in the data structure, the array editor does not automatically update its display. The array editor has no way of detecting the change, so you must call the Refresh method to force the array editor to redraw the display.


TOvcBaseArrayEditor hierarchy


TOvcBaseArrayEditor.AutoAdvanceChar
AutoAdvanceChar property

property TOvcBaseArrayEditor.AutoAdvanceChar : Boolean

Default: False

AutoAdvanceChar determines what happens if the caret is at the end of the cell and you enter another character.

If AutoAdvanceChar is True, the focus is advanced to the next cell. If AutoAdvanceChar is False, the caret remains where it is.

See also: AutoAdvanceLeftRight


TOvcBaseArrayEditor.AutoAdvanceLeftRight
AutoAdvanceLeftRight property

property TOvcBaseArrayEditor.AutoAdvanceLeftRight : Boolean

Default: False

AutoAdvanceLeftRight determines what happens if the caret is at the beginning or end of the cell and a cursor movement command is issued.

The first case to consider is when the caret is at the beginning of the cell and a command that would move the caret to the left is issued. If AutoAdvanceLeftRight is True, the focus is moved to the previous cell. If AutoAdvanceLeftRight is False, the caret remains where it is.

The second case to consider is when the caret is at the end of a cell and a command that would move the caret to the right is issued. If AutoAdvanceLeftRight is True, the focus is advanced to the next cell. If AutoAdvanceLeftRight is False, the caret remains where it is.

See also: AutoAdvanceChar


TOvcBaseArrayEditor.BeepOnError
BeepOnError property

property TOvcBaseArrayEditor.BeepOnError : Boolean

Default: True

BeepOnError determines whether a beep is sounded when an invalid character is entered.

If BeepOnError is True, MessageBeep is called when an invalid character is entered (for example, if <A> is entered in a numeric cell) or when a character is entered and the cell is full.


TOvcBaseArrayEditor.BorderStyle
BorderStyle property

property TOvcBaseArrayEditor.BorderStyle : TBorderStyle

Default: bsSingle

BorderStyle determines the style used when drawing the border.

The possible values are bsSingle (a single line border is drawn around the component) or bsNone (no border line).

The TBorderStyle type is defined in the Delphi Controls unit.


TOvcBaseArrayEditor.HighlightColors
HighlightColors property

property TOvcBaseArrayEditor.HighlightColors : TOvcColors

Default: clHighlightText and clHighlight

HighlightColors determines the colors used to display the highlighted portion of the cell.

See TOvcColors  for more information. Refer to the Delphi Color property for a list of available values and their meanings.

The following example displays highlighted text in blue with a white background.

AE1.HighlightColors.TextColor := clBlue;

AE1.HighlightColors.BackColor := clWhite;


TOvcBaseArrayEditor.ItemIndex
ItemIndex run-time property

property TOvcBaseArrayEditor.ItemIndex : LongInt

ItemIndex determines which array element is the selected cell.

The ItemIndex property (available only at run time) is used to determine which array element currently has the input focus and to move the input focus to a different array element. The array list is scrolled as necessary to make the newly assigned index item visible.

The array editor assumes that the array is 0-based; therefore, valid index values are 0 through NumItems-1. If a value outside this range is assigned to ItemIndex, it is ignored.

See also: NumItems


TOvcBaseArrayEditor.NumItems
NumItems property

property TOvcBaseArrayEditor.NumItems : LongInt

Default: depends on the height of the listbox

NumItems is the maximum number of items maintained by the array editor.

When scrolling through the array editor's list of values, NumItems determines when the last item has been displayed. NumItems can be changed at any time to reflect additions or deletions in the underlying data structure. This forces the array editor to repaint itself.


TOvcBaseArrayEditor.OnChange
OnChange event

property TOvcBaseArrayEditor.OnChange : TNotifyEvent;

OnChange defines an event handler that is called when the contents of the active edit cell are modified.

The method assigned to the OnChange event is called when the active edit cell is modified. Sender is the class instance of the array editor containing the active cell.

The following example causes ArrayEditor1Change to be called when the contents of the active cell change. A beep is produced for each change in the active edit cell.

procedure Form1.ArrayEditor1Change(Sender : TObject);

begin

  MessageBeep(0);

end;

...

OnChange := Form1.ArrayEditor1Change;


TOvcBaseArrayEditor.OnError
OnError event

property TOvcBaseArrayEditor.OnError : TValidationErrorEvent;

TValidationErrorEvent = procedure(Sender : TObject; ErrorCode : Word; ErrorMessage : string) of object;

OnError defines an event handler that is called when an array editor error occurs.

The method assigned to the OnError event is called when an error occurs. If no method is assigned to this event, the event handler assigned to the array editor's controller OnError event is called.

The possible values for ErrorCode are:

oeRangeError - The entered value is not within the accepted range.

oeInvalidNumber - An invalid number was entered in a numeric cell.

oeInvalidDate - An invalid date was entered in a date cell.

oeInvalidTime - An invalid time was entered in a time cell.

oeCustomError - The first error code reserved for user applications. All error values less than oeCustomError are reserved for use by Orpheus.

ErrorMessage is a short description of the error.

See the TOvcController component for additional information about error handling.


TOvcBaseArrayEditor.OnGetItem
OnGetItem event

property TOvcBaseArrayEditor.OnGetItem : TGetItemEvent;

TGetItemEvent = procedure(Sender : TObject; Index : LongInt; var Value : Pointer) of object;

OnGetItem defines an event handler that is called to get data addresses for the array editor.

The method assigned to the OnGetItem event is called to get a pointer (assigned to Value) to the data corresponding to the Index item of the array. If no method is assigned, the array editor displays sample data in all rows and ignores changes made to the edit cells.


TOvcBaseArrayEditor.OnGetItemColor
OnGetItemColor event

property TOvcBaseArrayEditor.OnGetItemColor : TGetItemColorEvent;

TGetItemColorEvent = procedure(Sender : TObject; Index : LongInt; var FG, BG : TColor) of object;

OnGetItemColor defines an event handler that is called to get the colors used to draw an array element.

The method assigned to the OnGetItemColor event is called by the array editor to get the colors to use when displaying the item specified by Index. On entry to the event handler, FG and BG contain the default foreground and background colors. Set FG and BG to the desired colors. Sender is the class instance of the array editor.

This event is not called to get colors for the active cell. The colors for the active cell are obtained from the current Font.Color and Color properties.

The following example displays every other array element using red as the text color.

procedure Form1.ArrayEditor1GetItemColor(Sender : TObject; Index : LongInt;

                                         var FG, BG : TColor);

begin

  if Odd(Index) then

    FG := clRed;

end;

...

OnGetItemColor := Form1.ArrayEditor1GetItemColor;


TOvcBaseArrayEditor.OnSelect
OnSelect event

property TOvcBaseArrayEditor.OnSelect : TSelectEvent

TSelectEvent = procedure(Sender : TObject; NewIndex : LongInt) of object;

OnSelect defines an event handler that is called to provide notification that a new item was selected.

NewIndex is the index value of the newly selected item. Sender is the class instance of the array editor.


TOvcBaseArrayEditor.OnUserCommand
OnUserCommand event

property TOvcBaseArrayEditor.OnUserCommand : TUserCommandEvent

TUserCommandEvent = procedure(Sender : TObject; Command : Word) of object;

OnUserCommand defines an event handler that is called when a user-defined command is entered.

The method assigned to the OnUserCommand event is called when you enter the key sequence corresponding to one of the user-defined commands, (ccUser1, ccUser2, etc.).

For example, suppose you add the <CtrlD> key sequence to one of the active command tables and assign it to the ccUser1 command. When you press <CtrlD>, the method assigned to the OnUserCommand event is called and ccUser1 is passed in Command.

See the TOvcCommandProcessor Class for additional information about user-defined commands and command tables.


TOvcBaseArrayEditor.OnUserValidation
OnUserValidation event

property TOvcBaseArrayEditor.OnUserValidation : TUserValidationEvent

TUserValidationEvent = procedure(Sender : TObject; var ErrorCode : Word) of object;

OnUserValidation defines an event handler that is called when cell validation is required.

The method assigned to the OnUserValidation event is called after the default validation is performed on the current array editor cell. Validation is performed when the array editor loses the focus.

ErrorCode contains the result of the validation. If it is zero, then the default validation didn't find any errors and you can perform any additional validation that is required. The error constants are defined in the OnError event.

If the OnUserValidation event handler determines that the cell contents are invalid, assign a value to ErrorCode before exiting the method. The error value should be greater than or equal to oeCustomError (32768).

Caution: The event handler assigned to the OnUserValidation event must not perform any actions that could cause the focus to change. This could cause Windows to lose track of where the focus is and could cause other problems as well. Do not display a form or dialog reporting the error. This should only be done in a method assigned to the components OnError event or the TOvcController's OnError event. The OnUserValidation event should only do what is necessary to confirm that the cell contents are valid.

See theTOvcController Component for additional information about error handling for multiple components.

See also: OnError


TOvcBaseArrayEditor.RangeHi
RangeHi property

property TOvcBaseArrayEditor.RangeHi : string

Default: depends on the array editor's data type

RangeHi is the upper limit for the range of allowable cell values.

This property is intended primarily for use at design time. However, it can be used at run time by assigning a string version of the desired range to the property. Range settings are ignored for string type array editors.

You can directly enter a range limit in the RangeHi edit field in the Object Inspector or you can invoke the Range Property Editor, which allows entry and validation of the range limit into a cell of the appropriate data type.

The following example sets an upper limit of 200 for the cells.

{AE1 is a simple array editor with a data type of Byte}

AE1.RangeHi := '200';

See also: RangeLo


TOvcBaseArrayEditor.RangeLo
RangeLo property

property TOvcBaseArrayEditor.RangeLo : string

Default: depends on the array editor's data type

RangeLo is the lower limit for the range of allowable cell values.

This property is intended primarily for use at design time. However, it can be used at run time by assigning a string version of the desired range to the property. Range settings are ignored for string type array editors.

You can directly enter a range limit in the RangeLo edit field in the Object Inspector or you can invoke the Range Property Editor, which allows entry and validation of the range limit into a cell of the appropriate data type.

The following example sets a lower limit of 10 for all cells.

{AE1 is a simple array editor with a data type of Byte}

AE1.RangeLo := '10';

See also: RangeHi


TOvcBaseArrayEditor.ReadOnly
ReadOnly property

property TOvcBaseArrayEditor.ReadOnly : Boolean

Default: False

ReadOnly indicates whether the array editor accepts user input.

If ReadOnly is False, the array editor will accept normal user input. If ReadOnly is True, the array editor ignores user input (including pasting from the clipboard), but scrolling, highlighting, and copying are still allowed.


TOvcBaseArrayEditor.RowHeight
RowHeight property

property TOvcBaseArrayEditor.RowHeight : Integer

Default: dependent on the parent font

RowHeight is the height of the array editor cells in pixels.

The row height is automatically determined based on the current font. Assigning a new value to the RowHeight property causes the array editor to resize each editing cell. The array editor is also resized if necessary to avoid displaying a partial row.


TOvcBaseArrayEditor.UseScrollBar
UseScrollBar property

property TOvcBaseArrayEditor.UseScrollBar : Boolean

Default: True

UseScrollBar determines if a vertical scrollbar is displayed.

If UseScrollBar is True, a vertical scrollbar is displayed at the right of the array editor.


TOvcBaseArrayEditor.events
TOvcBaseArrayEditor events

OnChange	OnGetItemColor

OnClick	OnKeyDown

OnDblClick	OnKeyPress

OnDragDrop	OnKeyUp

OnDragOver	OnMouseDown

OnEndDrag	OnMouseMove

OnEnter	OnMouseUp

OnError	OnSelect

OnExit	OnUserCommand

OnGetItem	OnUserValidation


TOvcBaseArrayEditor.methods
TOvcBaseArrayEditor methods

AlignControls 	Hide

Assign	InheritsFrom

AssignTo 	InitInstance

BeginDrag	InsertComponent

BringToFront	InsertControl

Broadcast	InstanceSize

CanFocus	Invalidate

ChangeName 	IsControlMouseMsg

ChangeScale 	KeyDown

ClassInfo	KeyPress

ClassName	KeyUp

ClassParent	Loaded

ClassType	MainWndProc

Click 	MethodAddress

ClientToScreen	MethodName

ContainsControl	MouseDown

ControlAtPos	MouseMove

Create	MouseUp

CreateHandle 	NewInstance

CreateSubClass 	NotifyControls

CreateWindowHandle 	PaintControls

DblClick 	PaintHandler

DefaultHandler 	PaintWindow

Destroy	PaletteChanged

DestroyComponents	Perform

DestroyHandle 	ReadState

Destroying	Realign

DestroyWindowHandle 	RecreateWnd

DestroyWnd 	Refresh

DisableAlign	RemoveComponent

Dispatch	RemoveControl

DoEnter 	Repaint

DoExit 	ScaleBy

DoKeyDown 	ScaleControls

DoKeyPress 	ScreenToClient

DoKeyUp 	ScrollBy

DragCanceled 	SelectFirst

Dragging	SelectNext

EnableAlign	SendToBack

EndDrag	SetBounds

FieldAddress	SetDesigning

FindComponent	SetFocus

FindNextControl 	SetName

Focused	SetParent

Free	SetTextBuf

FreeInstance	SetZOrder

GetClientOrigin 	Show

GetClientRect 	ShowControl

GetDeviceContext 	Update

GetPalette 	UpdateBoundsRect

GetTabOrderList	ValidateRename

GetTextBuf	VisibleChanging

GetTextLen	WndProc

HandleAllocated	WriteComponents

HandleNeeded	WriteState

HasParent


TOvcBaseArrayEditor.properties
TOvcBaseArrayEditor properties

Align	HelpContext

AutoAdvanceChar	HighlightColors

AutoAdvanceLeftRight	Hint

BeepOnError	IsControl

BorderStyle	ItemIndex

BoundsRect 	Left

Brush 	MouseCapture

Canvas  	Name

Caption  	NumItems

ClientHeight 	Owner

ClientOrigin 	Parent

ClientRect 	ParentColor

ClientWidth 	ParentCtl3D

Color	ParentFont

ComponentCount 	ParentShowHint

ComponentIndex 	PopupMenu

Components 	RangeHi

ComponentState 	RangeLo

ControlCount 	ReadOnly

Controller	RowHeight

Controls 	ShowHint

ControlState 	Showing

ControlStyle 	TabOrder

Ctl3D	TabStop

Cursor	Tag

DefWndProc  	Text

DesignInfo 	Top

DragCursor	UseScrollBar

DragMode	Visible

Enabled	Width

Font	WindowHandle

Handle

Height


TOvcBaseEntryField
TOvcBaseEntryField class

See also: properties, events, methods, hierarchy

Class Overview

The TOvcBaseEntryField class is an abstract class derived from TOvcBase. It provides the core functionality for the higher level entry field components. The functions provided by this class implement editing commands that are used in all of the derived entry field components.

Orpheus entry field components provide true field-by-field validation, range checking, and the ability to postpone validation. With easy-to-use picture masks, entry fields can edit and validate data in virtually any imaginable format.

Orpheus entry fields provide fully automatic support for international data entry and display. This includes currency values, date and time formats, displaying fractional values, and much more. This feature can be disabled or customized for each field.

In addition to the default validation that tests entered values to make sure they are within the limits of the field's data type, upper and lower range limits can be specified for nearly all field types. Additionally, special methods and events are provided to allow you to perform custom validation and custom error handling.

There are three high level components that are derived from the base entry field classes. These are the components to use for all your data entry needs:

•  TOvcSimpleField

•  TOvcPictureField

•  TOvcNumericField

TOvcSimpleField implements the Orpheus simple entry field, which is similar to the Windows standard edit control and the standard Delphi TEdit component. It is limited to a single line and its picture mask is one character. The mask character indicates the set of characters that are allowed and the maximum number of characters.

The picture entry field, which is implemented in TOvcPictureField, gives you more flexibility in format. It allows different mask characters for each character position in the field. This also allows you to specify literal characters in the entry field.

The numeric entry field, which is implemented in TOvcNumericField, is very similar to a picture entry field. The difference is that a numeric entry field gives you a calculator-style editor where numbers are entered in the field from right to left.

A data-aware version of each entry field type is also provided. The TOvcDbSimpleField, TOvcDbPictureField, and TOvcDbNumericField can be connected to a data source to allow editing of database fields.


TOvcBaseEntryField hierarchy


TOvcBaseEntryField.AsBoolean
AsBoolean run-time property

property TOvcBaseEntryField.AsBoolean : Boolean

AsBoolean determines the value of a Boolean entry field component.

If you use the AsBoolean property with a field that does not have a Boolean data type, an EInvalidDataType exception is raised.

The following example demonstrates testing and setting the Boolean value of an entry field.

if Field1.AsBoolean then

  {do something based on the field value being true}

Field1.AsBoolean := False; {set Field's value to False}

See also: AsXxx, GetValue, SetValue


TOvcBaseEntryField.AsCents
AsCents run-time property

property TOvcBaseEntryField.AsCents : LongInt

AsCents determines the value of an entry field editing a real data type.

The AsCents property provides a simple conversion to and from a whole number value (representing pennies) for editing by an entry field with a data type of Real, Double, Single, or Extended. The entry field does this by dividing the assigned value by 100 when the field value is set using AsCents and by multiplying the field value by 100 when the field contents are obtained using AsCents.

See also: AsXxx, GetValue, SetValue


TOvcBaseEntryField.AsDateTime
AsDateTime run-time property

property TOvcBaseEntryField.AsDateTime : TDateTime

AsDateTime determines the value of a Date or Time picture field component.

If you use the AsDateTime property with a field that does not have a Date or Time data type, an EInvalidDataType exception is raised.

The following example assigns the current date to Field1 and the current time to Field2.

Field1.AsDateTime := SysUtils.Date;

Field2.AsDateTime := SysUtils.Time;

See also: AsXxx, GetValue, SetValue


TOvcBaseEntryField.AsExtended
AsExtended run-time property

property TOvcBaseEntryField.AsExtended : Extended

AsExtended determines the value of a field with an extended data type.

AsExtended allows you to set and retrieve the contents of an Extended or Comp field. If you use AsExtended with a field that has any other data type, an EInvalidDataType exception is raised.

See also: AsXxx, GetValue, SetValue


TOvcBaseEntryField.AsFloat
AsFloat run-time property

property TOvcBaseEntryField.AsFloat : Double

AsFloat determines the value of a field with a floating point data type.

AsFloat allows you to set and retrieve the contents of a Real, Double, or Single field. If you use AsFloat with a field that has any other data type, an EInvalidDataType exception is raised.

The following example uses AsFloat to assign a value to a field.

Field1.AsFloat := 5.34;

See also: AsXxx, GetValue, SetValue


TOvcBaseEntryField.AsInteger
AsInteger run-time property

property TOvcBaseEntryField.AsInteger : LongInt

AsInteger determines the value of a field with a whole number data type.

AsInteger allows you to set and retrieve the contents of an Integer, LongInt, ShortInt, Byte, or Word field. If you use AsInteger with a field that does not have a whole number data type, an EInvalidDataType exception is raised.

The following example uses AsInteger to assign a value to a field.

Field1.AsInteger := 30;

See also: AsXxx, GetValue, SetValue


TOvcBaseEntryField.AsOvcDate
AsOvcDate run-time property

property TOvcBaseEntryField.AsOvcDate : TOvcDate

AsOvcDate determines the value of a date picture field component.

If you use the AsOvcDate property with a field that does not have a TOvcDate data type, an EInvalidDataType exception is raised.

The following example assigns an Orpheus date value to Field1.

Field1.AsOvcDate := OvcDT.CurrentDate;

See also: AsXxx, OvcDT.CurrentDate, GetValue, SetValue


TOvcBaseEntryField.AsOvcTime
AsOvcTime run-time property

property TOvcBaseEntryField.AsOvcTime : TOvcTime

AsOvcTime determines the value of a time picture field component.

If you use the AsOvcTime property with a field that does not have a Time data type, an EInvalidDataType exception is raised.

The following example assigns an Orpheus time value to Field1.

Field1.AsOvcTime := OvcDT.CurrentTime;

See also: AsXxx, OvcDT.CurrentTime, GetValue, SetValue


TOvcBaseEntryField.AsString
AsString run-time property

property TOvcBaseEntryField.AsString : string

AsString determines the value of any Orpheus entry field component.

The returned string represents the value displayed by the entry field component. If the TrimBlanks property is True, leading and trailing blanks are removed before the value is returned. Use EditString to obtain the display string without modifications. Or, use GetStrippedEditString to obtain the edit string with all mask characters removed.

The string value assigned to the AsString property must be convertible into the appropriate field data type. For example, assigning 'ABC' to a field with an Integer data type is invalid. If the value assigned to this property is invalid, unpredictable display values will result.

The following example assumes that Field1 is an Integer data type.

Field1.AsString := '345';

See also: AsXxx, EditString, GetStrippedEditString, GetValue, SetValue


TOvcBaseEntryField.AsXxx
AsXxx run-time properties

The AsXxx properties determine the value of an entry field component.

If you use the AsXxx property with a field that does not have a compatible data type, an EInvalidDataType exception is raised.

The following is a list of the AsXxx properties:

AsBoolean

AsCents

AsDateTime

AsExtended

AsFloat

AsInteger

AsOvcDate

AsOvcTime

AsString


TOvcBaseEntryField.AutoAdvanceChar
AutoAdvanceChar property

property TOvcBaseEntryField.AutoAdvanceChar : Boolean

Default: False

AutoAdvanceChar determines what happens if the caret is at the end of the entry field and you enter another character.

If AutoAdvanceChar is True, the focus is advanced to the next component in the tab order. If AutoAdvanceChar is False, the caret remains where it is.

See also: AutoAdvanceLeftRight


TOvcBaseEntryField.AutoAdvanceLeftRight
AutoAdvanceLeftRight property

property TOvcBaseEntryField.AutoAdvanceLeftRight : Boolean

Default: False

AutoAdvanceLeftRight determines what happens if the caret is at the beginning or end of the entry field and a cursor movement command is issued.

The first case to consider is when the caret is at the beginning of the field and a command that would normally move the caret to the left is issued. If AutoAdvanceLeftRight is True, the focus is moved to the previous component in the tab order. If AutoAdvanceLeftRight is False, the caret remains where it is.

The second case to consider is when the caret is at the end of a field and a command that would normally move the caret to the right is issued. If AutoAdvanceLeftRight is True, the focus is advanced to the next component in the tab order. If AutoAdvanceLeftRight is False, the caret remains where it is.

See also: AutoAdvanceChar


TOvcBaseEntryField.AutoAdvanceUpDown
AutoAdvanceUpDown property

property TOvcBaseEntryField.AutoAdvanceUpDown : Boolean

Default: False

AutoAdvanceUpDown determines whether the cursor keys change the focus.

If AutoAdvanceUpDown is True, the <Up> key is treated the same as <ShiftTab>, which moves the focus to the previous component on the form, and the <Down> key is treated the same as <Tab>, which moves the focus to the next component on the form.

See also: AutoAdvanceChar


TOvcBaseEntryField.AutoSelect
AutoSelect property

property TOvcBaseEntryField.AutoSelect : Boolean

Default: True

AutoSelect determines whether the field is selected when it receives the focus.

If AutoSelect is True, the contents of the field are selected when the field receives the focus.

See also: SelectAll, SelectionLength, SelectionStart


TOvcBaseEntryField.AutoSize
AutoSize property

property TOvcBaseEntryField.AutoSize : Boolean

Default: True

AutoSize determines whether the entry field component should resize its height when the font changes.

If AutoSize is True, the height of the component is adjusted so that the font is completely visible.


TOvcBaseEntryField.BeepOnError
BeepOnError property

property TOvcBaseEntryField.BeepOnError : Boolean

BeepOnError determines whether a beep is sounded when an invalid character is entered.

If BeepOnError is True, MessageBeep is called when an invalid character is entered (for example, if <A> is entered in a numeric field) or when a character is entered and the field is full (and the InsertPushes property is set to False).


TOvcBaseEntryField.BorderStyle
BorderStyle property

property TOvcBaseEntryField.BorderStyle : TBorderStyle

Default: bsSingle

BorderStyle determines the style used when drawing the border.

The possible values are bsSingle (a single line border is drawn around the component) or bsNone (no border line).

The TBorderStyle type is defined in the Delphi Controls unit.


TOvcBaseEntryField.CaretIns
CaretIns property

property TOvcBaseEntryField.CaretIns : TOvcCaretType

Default: vertical line caret

CaretIns determines the characteristics of the editing caret.

This property allows you to customize the attributes of the editing caret used while the edit field is in insert mode. For additional information see the TOvcCaret Class.

See also: CaretOvr


TOvcBaseEntryField.CaretOvr
CaretOvr property

property TOvcBaseEntryField.CaretOvr : TOvcCaretType

Default: block caret

CaretOvr determines the characteristics of the editing caret.

This property allows you to customize the attributes of the editing caret used while the edit field is in overwrite mode. For additional information see the TOvcCaret Class.

See also: CaretIns


TOvcBaseEntryField.CaretToEnd
CaretToEnd property

property TOvcBaseEntryField.CaretToEnd : Boolean

Default: True

CaretToEnd determines where the caret is placed when the field receives the focus.

If CaretToEnd is True, as it is by default, the caret is placed at the end of the field's display string when the field receives the focus. If CaretToEnd is False, the caret is placed at the beginning of the display string.


TOvcBaseEntryField.ClearContents
ClearContents method

procedure TOvcBaseEntryField.ClearContents;

ClearContents deletes the field's entire display string.

Literal characters, such as date and time separators, are not deleted.

See also: ClearSelection


TOvcBaseEntryField.ClearSelection
ClearSelection method

procedure TOvcBaseEntryField.ClearSelection;

ClearSelection deletes the selected portion of the display string.

Literal characters, such as date and time separators, are not deleted. If no text is selected, ClearSelection does nothing.

See also: ClearContents


TOvcBaseEntryField.ControlCharColor
ControlCharColor property

property TOvcBaseEntryField.ControlCharColor : TColor

Default: clRed

ControlCharColor is the color used to display control characters in an entry field.


TOvcBaseEntryField.Controller
Controller property

property TOvcBaseEntryField.Controller : TOvcController

Controller allows access to the properties of the TOvcController non-visual component attached to the entry field.

This property provides access to a common command processor that interprets all keyboard input, a central error handler that is used if a field-specific error handler is not assigned, and additional properties that allow the entry field to ignore field errors if the focus is moving to a Help, Cancel, or Restore button.

All entry fields must have a controller assigned and in most cases this is done automatically. If a Controller is not assigned, an ENoControllerAssigned exception is raised at run time.


TOvcBaseEntryField.CopyToClipboard
CopyToClipboard method

procedure TOvcBaseEntryField.CopyToClipboard;

CopyToClipboard copies the selected portion of the display string to the Windows clipboard.

CopyToClipboard erases the existing contents of the clipboard. If no text is selected, calling CopyToClipboard has no effect and the existing clipboard contents are left intact.

See also: CutToClipboard, PasteFromClipboard


TOvcBaseEntryField.CurrentPos
CurrentPos run-time property

property TOvcBaseEntryField.CurrentPos : Integer

CurrentPos determines the position of the caret within the entry field component at run time.

Valid values are 0 (the start of the field) through the length of the current display string. If a value less than 0 is assigned to CurrentPos, the caret is placed at the start of the entry field. If a value greater than the length of the display string is assigned to CurrentPos, the caret is positioned just past the last character.

If the requested position is at a literal or semi-literal, the caret is placed at the next position that is not a literal or semi-literal.

If the field does not have the focus, assignments to CurrentPos are ignored and -1 is returned.

The following examples show how to position the caret at the beginning and at the end of a field.

{set the position of the caret to the beginning of the field}

Field1.CurrentPos := 0;

{set the position of the caret to the end of the display string}

Field1.CurrentPos := MaxInt;


TOvcBaseEntryField.CutToClipboard
CutToClipboard method

procedure TOvcBaseEntryField.CutToClipboard;

CutToClipboard copies the selection to the Windows clipboard and then deletes the selected text.

CutToClipboard erases the existing contents of the clipboard. If no text is selected, calling CutToClipboard has no effect and the existing clipboard contents are left intact.

See also: CopyToClipboard, PasteFromClipboard


TOvcBaseEntryField.DataSize
DataSize run-time property

property TOvcBaseEntryField.DataSize : Word

DataSize returns the number of bytes required to store the specified data type.

The data type is determined by the DataType property. For example, if the field's data type is Byte, DataSize returns 1 and if the data type is LongInt, DataSize returns 4.

See also: TOvcSimpleField.DataType, TOvcPictureField.DataType, TOvcNumericField.DataType


TOvcBaseEntryField.DecimalPlaces
DecimalPlaces property

property TOvcBaseEntryField.DecimalPlaces : Byte

Default: 0

DecimalPlaces is the number of digits that are displayed to the right of the decimal point.

DecimalPlaces is useful only for fields configured to edit real data types and is not used by others.


TOvcBaseEntryField.DecreaseValue
DecreaseValue method

procedure TOvcBaseEntryField.DecreaseValue(Wrap : Boolean; Delta : Double);

DecreaseValue decrements the field value by the amount specified in Delta.

If Wrap is True and the reduced field value would be below the field's allowable lower limit, the new value is set to the field's upper limit.

DecreaseValue has no effect for string field types.

The following example shows how DecreaseValue "wraps" a field value.

{Field1 is a byte field and its current value is 0}

{using default range settings}

Field1.DecreaseValue(True, 1);

{new display string shows "255"}

...

{Field2 is a byte field and its current value is 50}

{lower range is set to 40 and upper range is 60}

Field2.DecreaseValue(True, 20);

{new display string shows "60"}

See also: IncreaseValue


TOvcBaseEntryField.DisplayString
DisplayString run-time read-only property

property TOvcBaseEntryField.DisplayString : string

DisplayString returns the string displayed in the entry field.

This read-only property provides a copy of the string displayed by the entry field. The display string differs from the edit string in special cases such as when the PasswordMode property is True.

See also: EditString


TOvcBaseEntryField.EditString
EditString run-time read-only property

property TOvcBaseEntryField.EditString : string

EditString returns a copy of the entry field's display string.

The returned string contains all mask characters and any leading and trailing spaces.

The following example gets a copy of the edit string in Field1.

S := Field1.EditString;

See also: AsString, GetStrippedEditString


TOvcBaseEntryField.ErrorColors
ErrorColors property

property TOvcBaseEntryField.ErrorColors : TOvcColors

Default: clBlack (for the text color), clRed (for the background color)

ErrorColors determines the colors used for the component's display string when its contents are invalid.

The following example displays red text on a blue background when Field1 has an invalid value.

Field1.ErrorColors.TextColor := clRed;

Field1.ErrorColors.BackColor := clBlue;


TOvcBaseEntryField.EverModified
EverModified run-time property

property TOvcBaseEntryField.EverModified : Boolean

EverModified determines the modified status of the entry field component.

The EverModified state of an entry field component is cleared when a value is assigned to the field. This property differs from the Modified property in that once EverModified becomes True, it remains True until the field value is changed by some action in your program.

When EverModified is set to False, the Modified property is also set to False.

The following example checks to see if Field1 has been modified since the form was displayed.

if Field1.EverModified then begin

  {field value has changed, save the contents to a file}

  ...

end;

See also: Modified


TOvcBaseEntryField.FieldIsEmpty
FieldIsEmpty method

function TOvcBaseEntryField.FieldIsEmpty : Boolean;

FieldIsEmpty determines whether an entry field is completely empty.

FieldIsEmpty returns False if the entry field contains any characters other than literal or semi-literal characters.


TOvcBaseEntryField.ForceInsert
ForceInsert property

property TOvcBaseEntryField.ForceInsert : Boolean

Default: False

ForceInsert determines whether insert mode is forced.

If you set ForceInsert to True, the field is always in insert mode, regardless of the use of the <Ins> key or the insert state of other entry fields on the form.

See also: ForceOvertype


TOvcBaseEntryField.ForceOvertype
ForceOvertype property

property TOvcBaseEntryField.ForceOvertype : Boolean

Default: False

ForceOvertype determines whether overtype mode is forced.

If you set ForceOvertype to True, the field is always in overtype mode, regardless of the use of the <Ins> key or the insert state of other entry fields on the form.

See also: ForceInsert


TOvcBaseEntryField.GetStrippedEditString
GetStrippedEditString virtual method

function TOvcBaseEntryField.GetStrippedEditString : string; dynamic;

GetStrippedEditString returns the display string, stripped of all literal and semi-literal characters.

For simple fields, this simply returns the display string. Descendent entry field classes override this method to strip literal and semi-literal characters from the display string.

See also: AsXxx, GetValue


TOvcBaseEntryField.GetValue
GetValue method

function TOvcBaseEntryField.GetValue(var Data) : Word;

GetValue retrieves the value of a field directly into a variable of the appropriate data type.

Data is an untyped variable parameter that must match the data type of the entry field. You must ensure that they match because GetValue does not.

GetValue forces a validation of the field contents. The function result is an error code if the field fails the validation, or zero if there is no error.

The following example assumes that Field1 is a simple real field.

var

  R : Real;

  I : Integer;

begin

...

  if Field1.GetValue(R) = 0 then

    {return value is valid--do something with it}

...

  {*** the following is incorrect and will cause a memory overwrite ***}

  if Field1.GetValue(I) = 0 then ...

  {*** I is not the same data type as the field ***}

See also: TOvcNumericField.DataType, TOvcPictureField.DataType, TOvcSimpleField.DataType, SetValue


TOvcBaseEntryField.HighlightColors
HighlightColors property

property TOvcBaseEntryField.HighlightColors : TOvcColors

Default: clHighlightText (for the text color) and clHighlight (for the background color)

HighlightColors determines the colors used to display the highlighted portion of the field.

The following example displays highlighted text in blue with a white background.

Field1.ErrorColors.TextColor := clBlue;

Field1.ErrorColors.BackColor := clWhite;

See also: ErrorColors


TOvcBaseEntryField.IncreaseValue
IncreaseValue method

procedure TOvcBaseEntryField.IncreaseValue(Wrap : Boolean; Delta : Double);

IncreaseValue increments the field value by the amount specified in Delta.

If Wrap is True and the increased field value would be above the field's allowable upper limit, the new value is set to the field's lower limit.

IncreaseValue has no effect for string field types.

The following example shows how IncreaseValue "wraps" a field value.

{Field1 is a byte field and its current value is 255}

{using default range settings}

Field1.IncreaseValue(True, 1);

{new display string shows "0"}

...

{Field2 is a byte field and its current value is 50}

{lower range is set to 40 and upper range is 60}

Field2.IncreaseValue(True, 20);

{new display string shows "40"}

See also: DecreaseValue


TOvcBaseEntryField.InputRequired
InputRequired property

property TOvcBaseEntryField.InputRequired : Boolean

InputRequired indicates whether an entry field must be filled.

If InputRequired is True, the entry field cannot be left empty. Normally, only fields of type string, Date, and Time are marked as required. When the field is validated, an oeRequiredField error is generated if InputRequired is True. There are also other conditions under which these fields are considered to be "empty." For example, a Date field whose value evaluates to BadDate is considered empty, and generates an error if the field is marked as required. Similarly, Time fields that evaluate to BadTime generate oeRequiredField errors.

It is possible to create a required field of a type other than string, Date, and Time. If you do, the Uninitialized property is automatically set to True.


TOvcBaseEntryField.InsertPushes
InsertPushes property

property TOvcBaseEntryField.InsertPushes : Boolean

Default: True

InsertPushes determines what happens when characters are entered into a completely filled entry field.

If InsertPushes is True, as it is by default, and a character is entered into a full entry field (or subfield), a character at the right-most position in the field (or subfield) is "pushed" off the end. If InsertPushes is False, characters entered into a full entry field (or subfield) are ignored.


TOvcBaseEntryField.IntlSupport
IntlSupport run-time property

property TOvcBaseEntryField.IntlSupport : TOvcIntlSup

Default: OvcIntlSup

IntlSupport provides access to the international support object that is attached to the entry field component.

A global international support object is created during initialization and all entry field components use it by default. You can create an additional TOvcIntlSup object, tailor the international settings, and attach it to the entry field component by assigning it to this property.

The following example creates a new international support object and attaches it to Field1. When the field needs to display the comma character, it uses a '.' character instead of the character specified in the WIN.INI file.

var

  MyIntlSupport : TOvcIntlSup;

...

  MyIntlSupport := TOvcIntlSup.Create;

  {turn off auto update flag so changes to WIN.INI}

  {will not trigger resetting of our changes}

  MyIntlSupport.AutoUpdate := False;

  {assign a new comma character}

  MyIntlSupport.CommaChar := '.';

...

  {attach the new international support object to our field}

  Field1.IntlSup := MyIntlSupport;


TOvcBaseEntryField.IsValid
IsValid method

function TOvcBaseEntryField.IsValid : Boolean;

IsValid determines whether a field passed its last validation test.

IsValid returns True if the field passed its last validation test, otherwise it returns False. This method is meaningful only if the field is using the SoftValidation option. IsValid is useful when the form is about to be closed or when preparing to commit the data in a form to storage.

See also: SoftValidation


TOvcBaseEntryField.LastError
LastError run-time property

property TOvcBaseEntryField.LastError : Word

LastError is the result of the last field validation.

LastError is set when the entry field is validated. See OnError for a description of the possible error values.

See also: OnError, ValidateSelf


TOvcBaseEntryField.MaxLength
MaxLength property

property TOvcBaseEntryField.MaxLength : Word

Default: dependent on the field's data type

MaxLength is the maximum number of characters that can be entered in the field.

MaxLength determines the logical width (in characters) of the entry field. This value does not change the physical width of the entry field. It limits the number of characters that are accepted. The maximum length for MaxLength is 255.


TOvcBaseEntryField.MergeWithPicture
MergeWithPicture virtual method

procedure TOvcBaseEntryField.MergeWithPicture(const S : string); dynamic;

MergeWithPicture merges a string with a field's picture mask.

MergeWithPicture combines the string specified by S with the field's picture mask and updates the edit string.

The following example uses a picture mask of '(999) 999-999'. The result is '(800) 333-4160' as the entry field's edit string.

Field1.MergeWithPicture('8003334160');

See also: TOvcNumericField.PictureMask, TOvcPictureField.PictureMask, TOvcSimpleField.PictureMask


TOvcBaseEntryField.Modified
Modified run-time property

property TOvcBaseEntryField.Modified : Boolean

Modified determines the modified state of the entry field component.

The modified status of an entry field component is initially False when the field receives the focus. It is changed to True when the field is changed. This property is most useful in a post-edit routine when deciding whether to take an action that is necessary only if the field changed. Modified is changed to False when the focus leaves the entry field.

When Modified is set to True, EverModified is set to True. When Modified is set to False, EverModified is not changed.

See also: EverModified


TOvcBaseEntryField.MoveCaret
MoveCaret method

procedure TOvcBaseEntryField.MoveCaret(Delta : Integer);

MoveCaret positions the editing caret in the edit field relative to its current position.

If Delta is positive, the editing caret is moved to the right by the number of character positions specified by Delta. If Delta is negative, the editing caret is moved to the left.

If Delta specifies a position before the beginning or after the end of the edit field, the caret is placed at the beginning or the end of the field respectively. If the new position of the caret is on a non-editable position (such as a literal), the caret is placed before (if Delta is negative) or after (if Delta is positive) the literal character.

See also: CurrentPos


TOvcBaseEntryField.OnChange
OnChange event

property TOvcBaseEntryField.OnChange : TNotifyEvent

OnChange defines an event handler that is called when an entry field is edited.

The method assigned to the OnChange event is called when the edit field is modified (for example, each time a character is entered).


TOvcBaseEntryField.OnError
OnError event

property TOvcBaseEntryField.OnError : TValidationErrorEvent;

TValidationErrorEvent = procedure(Sender : TObject; ErrorCode : Word; ErrorMessage : string) of object;

OnError defines an event handler that is called when an entry field error occurs.

The method assigned to the OnError event is called when an error occurs. If no method is assigned to this event, the event handler assigned to the field's controller OnError event is called.

The possible values for ErrorCode are:

oeRangeError - The entered value is not within the accepted range.

oeInvalidNumber - An invalid number was entered in a numeric field.

oeRequiredField - A required field was left blank.

oeInvalidDate - An invalid date was entered in a date field.

oeInvalidTime - An invalid time was entered in a time field.

oeBlanksInField - A blank was left in a field or subfield that does not allow blanks. This error is reported only by the validation helper routines ValidateNoBlanks and ValidateSubfields in OVCVALID.

oePartialEntry - A partial entry was given in a field or subfield that must either be entirely empty or entirely full. This error is reported only by the validation helper routines ValidateNotPartial and ValidateSubfields in OVCVALID.

oeCustomError - The first error code reserved for user applications. All error values less than oeCustomError are reserved for use by Orpheus. oeCustomError is defined in the OvcData unit as 32768.

ErrorMessage is a short description of the error.

See the TOvcController Component for additional information about error handling for multiple entry fields.

See also: Controller


TOvcBaseEntryField.OnUserCommand
OnUserCommand event

property TOvcBaseEntryField.OnUserCommand : TUserCommandEvent

TUserCommandEvent = procedure(Sender : TObject; Command : Word) of object;

OnUserCommand defines an event handler that is called when a user-defined command is entered.

The method assigned to the OnUserCommand event is called when you enter the key sequence corresponding to one of the user-defined commands (ccUser1, ccUser2, etc.).

For example, suppose you add the <CtrlD> key sequence to one of the active command tables and assign it to the ccUser1 command. When you press <CtrlD>, the method assigned to the OnUserCommand event is called and ccUser1 is passed in Command.

See the TOvcCommandProcessor Class for additional information about user-defined commands and command tables.


TOvcBaseEntryField.OnUserValidation
OnUserValidation event

property TOvcBaseEntryField.OnUserValidation : TUserValidationEvent

TUserValidationEvent = procedure(Sender : TObject; var ErrorCode : Word) of object;

OnUserValidation defines an event handler that is called when field validation is required.

The method assigned to the OnUserValidation event is called after the default validation is performed on the field. Validation is performed when the field loses the focus and when the contents of the field are retrieved using the AsXxx properties or the GetValue method.

ErrorCode contains the result of the validation. If it is zero, then the default validation didn't find any errors and you can perform any additional validation that is required. The error constants are defined in the OnError event.

If the OnUserValidation event handler determines that the field is invalid, assign a value to ErrorCode before exiting the method. The error value should be greater than or equal to oeCustomError (32768). Note that attempts to change the field's value while user validation is in progress are ignored.

Caution: The event handler assigned to the OnUserValidation event must not perform any actions that could cause the focus to change. This could cause Windows to lose track of where the focus is and could cause other problems as well. Do not display a form or dialog reporting the error. This should only be done in a method assigned to the field's OnError event handler or the TOvcController OnError event handler. The OnUserValidation event should only do what is necessary to confirm that the field is valid.

See the TOvcController Component for additional information about error handling for multiple entry fields.

See also: OnError


TOvcBaseEntryField.PadChar
PadChar property

property TOvcBaseEntryField.PadChar : Char

Default: #32 (space)

PadChar is the character that is used to fill the blank portion of the display string.

The following example sets the pad character to an underscore. Field1 is a picture string field with a mask of '(999) 999-9999'.

Field1.PadChar := '_';

The displayed field will be '(___) ___-____'.


TOvcBaseEntryField.PasswordChar
PasswordChar property

property TOvcBaseEntryField.PasswordChar : Char

Default: '*'

PasswordChar is the character that is displayed instead of the entered text if the field is in password mode.

If the PasswordMode property is True, the character assigned to PasswordChar is displayed instead of the characters entered into the field.

See also: PasswordMode


TOvcBaseEntryField.PasswordMode
PasswordMode property

property TOvcBaseEntryField.PasswordMode : Boolean

Default: False

PasswordMode determines whether entered characters are displayed.

If you set PasswordMode to True, the character assigned to the PasswordChar property is displayed instead of the characters that are entered.

See also: PasswordChar


TOvcBaseEntryField.PasteFromClipboard
PasteFromClipboard method

procedure TOvcBaseEntryField.PasteFromClipboard;

PasteFromClipboard copies the contents of the Windows clipboard into the edit field.

See also: CopyToClipboard, CutToClipboard


TOvcBaseEntryField.RangeHi
RangeHi property

property TOvcBaseEntryField.RangeHi : string

Default: depends on the field's data type

RangeHi is the upper limit for the range of allowable field values.

This property is intended primarily for use at design time. However, it can be used at run time by assigning a string version of the desired range to the property. Range settings are ignored for string type fields.

You can directly enter a range limit in the RangeHi edit field in the Object Inspector or you can invoke the Range Property Editor, which allows entry and validation of the range limit into an Orpheus entry field of the appropriate data type.

The following example sets an upper limit of 200 for Field1.

{Field1 is a simple field with a data type of Byte}

Field1.RangeHi := '200';

See also: RangeLo, SetRangeHi, SetRangeLo


TOvcBaseEntryField.RangeLo
RangeLo property

property TOvcBaseEntryField.RangeLo : string

Default: depends on the field's data type

RangeLo is the lower limit for the range of allowable field values.

This property is intended primarily for use at design time. However, it can be used at run time by assigning a string version of the desired range to the property. Range settings are ignored for string type fields.

You can directly enter a range limit in the RangeLo edit field in the Object Inspector or you can invoke the Range Property Editor, which allows entry and validation of the range limit into an Orpheus entry field of the appropriate data type.

The following example sets a lower limit of 10 for Field1.

{Field1 is a simple field with a data type of Byte}

Field1.RangeLo := '10';

See also: RangeHi, SetRangeHi, SetRangeLo


TOvcBaseEntryField.ReadOnly
ReadOnly property

property TOvcBaseEntryField.ReadOnly : Boolean

Default: False

ReadOnly indicates whether the field accepts user input.

If ReadOnly is False, the field will accept normal user input. If ReadOnly is True, the field ignores user input (including pasting from the clipboard), but scrolling, highlighting, and copying are still allowed.


TOvcBaseEntryField.Restore
Restore virtual method

procedure TOvcBaseEntryField.Restore; dynamic;

Restore returns the contents of the edit field to the value it contained when it last received the focus.

If you use the default command-key mapping table, this method is called when you enter <AltBackSpace> or <CtrlZ>.


TOvcBaseEntryField.RightJustify
RightJustify property

property TOvcBaseEntryField.RightJustify : Boolean

Default: False

RightJustify determines whether the field contents are right justified.

If RightJustify is True, entered text is automatically right-justified after the field loses the focus. If RightJustify is set to True for string entry fields, you will probably want to enable the TrimBlanks property also. If the Picture mask contains any literal or semi-literal characters, RightJustify is automatically set to False.

See also: TrimBlanks


TOvcBaseEntryField.SelectAll
SelectAll method

procedure TOvcBaseEntryField.SelectAll;

SelectAll selects the entire contents of the edit field.

See also: ClearSelection, SelectedText, SelectionLength, SelectionStart, SetSelection


TOvcBaseEntryField.SelectedText
SelectedText run-time read-only property

property TOvcBaseEntryField.SelectedText : string

SelectedText returns a string containing the selected portion of the field's display string.

The field does not need to have the focus to use this property.

See also: ClearSelection, SelectAll, SelectionLength, SelectionStart, SetSelection


TOvcBaseEntryField.SelectionLength
SelectionLength run-time property

property TOvcBaseEntryField.SelectionLength : Integer

SelectionLength is the length of the selected portion of the field's display string.

The valid range for SelectionLength is from 0 to the length of the field's display string. Leading and trailing blanks are highlighted if they are within the specified area. If the requested length exceeds the maximum length of the field, the selection is extended to the end of the field.

The following example increases the selection by 2 characters.

Field1.SelectionLength := Field1.SelectionLength + 2;

See also: ClearSelection, SelectAll, SelectedText, SelectionStart, SetSelection


TOvcBaseEntryField.SelectionStart
SelectionStart run-time property

property TOvcBaseEntryField.SelectionStart : Integer

SelectionStart is the starting position of the selected portion of the field's display string.

The valid range for SelectionStart is from 0 to the length of the field's display string. If the starting position is greater than or equal to the ending position, no text is highlighted.

The following example sets the starting position for the highlighted portion of the field's display string to 2.

Field1.SelectionStart := 2;

See also: ClearSelection, SelectAll, SelectedText, SelectionLength, SetSelection


TOvcBaseEntryField.SetInitialValue
SetInitialValue method

procedure TOvcBaseEntryField.SetInitialValue;

SetInitialValue initializes the field contents.

The initial value for string fields is an empty string. For numeric entry fields, the initial value is 0 or the lowest range value if the low range value is anything other than the default low range value.

For example, if you call SetInitialValue for an entry field editing a real data type with RangeLo set to -10, the field contents are set to -10.

See also: TOvcSimpleField.DataType, TOvcPictureField.DataType, TOvcNumericField.DataType, RangeLo


TOvcBaseEntryField.SetRangeHi
SetRangeHi method

procedure TOvcBaseEntryField.SetRangeHi(const Value : OvcData.TRangeType);

SetRangeHi sets the upper limit for the field.

The following example sets the upper limit for Field1 to 200. If a value larger than 200 is entered, a range exception is raised.

var

  R : TRangeType;

...

  R.rtWord := 200;

  {Field1 is a "Word" field}

  Field1.SetRangeHi(R);

See also: RangeHi, RangeLo, SetRangeLo


TOvcBaseEntryField.SetRangeLo
SetRangeLo method

procedure TOvcBaseEntryField.SetRangeLo(const Value : OvcData.TRangeType);

SetRangeLo sets the lower limit for the field.

The following example sets the lower limit for Field1 to 50. If a value smaller than 50 is entered, a range exception is raised.

var

  R : TRangeType;

...

  R.rtWord := 50;

  {Field1 is a "Word" field}

  Field1.SetRangeLo(R);

See also: RangeHi, RangeLo, SetRangeHi


TOvcBaseEntryField.SetSelection
SetSelection method

procedure TOvcBaseEntryField.SetSelection(Start, Stop : Word);

SetSelection changes the selected portion of a field's display string.

SetSelection highlights the range starting at the character position specified by Start and ending with the character position specified by Stop (inclusive). The valid range for Start and Stop is from 0 to the length of the field's display string. If the starting position is greater than or equal to the ending position, no text is highlighted.

The following example sets the starting position for selection at the second character position and the ending position at the fifth character position.

Field1.SetSelection(2, 5);

See also: ClearSelection, SelectAll, SelectedText, SelectionLength, SelectionStart


TOvcBaseEntryField.SetValue
SetValue method

procedure TOvcBaseEntryField.SetValue(const Data);

SetValue assigns a value to a field directly from a variable of the appropriate data type.

Data is an untyped parameter that must have the same data type as the entry field. The value passed in Data is assumed to be valid.

The following example assumes that Field1 is a simple real field.

var

  R : Real;

  I : Integer;

begin

...

  R := 33;

  {set the value of Field1}

  Field1.SetValue(R);

...

  {*** the following is incorrect and will cause unpredictable results ***}

  Field1.SetValue(I);

  {*** I is not the same data type as the field ***}

See also: TOvcNumericField.DataType, TOvcPictureField.DataType, TOvcSimpleField.DataType, GetValue


TOvcBaseEntryField.SoftValidation
SoftValidation property

property TOvcBaseEntryField.SoftValidation : Boolean

Default: False

SoftValidation determines what happens when errors are detected by the validation routines.

When SoftValidation is True, errors detected by the validation routines are not reported when the user moves to another field. A flag is set to indicate that the field contents are invalid. Errors can be detected only by testing the IsValid property of the field or by calling the controller's ValidateForm method. If the field has an error, it is displayed using the colors defined by the ErrorColors property.

See also: ErrorColors, IsValid, TOvcController.ValidateEntryFields


TOvcBaseEntryField.StripLiterals
StripLiterals property

property TOvcBaseEntryField.StripLiterals : Boolean

Default: False

StripLiterals determines whether literal characters are removed from the edit string when the field contents are retrieved.

If StripLiterals is True, literal characters are removed from the display string when the entry field contents are retrieved. For example, assume a picture field with a mask of '(999) 999-9999' and that the field displays '(800) 460-3333' at run time. If StripLiterals is True, the string obtained using the AsString property is '8004603333'. If StripLiterals is False, the returned string is '(800) 460-3333'.

See also: AsString


TOvcBaseEntryField.TrimBlanks
TrimBlanks property

property TOvcBaseEntryField.TrimBlanks : Boolean

Default: True

TrimBlanks determines whether leading and trailing blanks are removed.

If TrimBlanks is True, leading and trailing blanks entered in the string by the user are removed automatically when the entry field contents are retrieved. Blanks that are part of the picture mask are not removed.


TOvcBaseEntryField.Uninitialized
Uninitialized property

property TOvcBaseEntryField.Uninitialized : Boolean

Uninitialized determines if the field contents are displayed.

If Uninitialized is True, the field is blanked out completely except when it has the focus. The state of this property is set to False when the field is modified.


TOvcBaseEntryField.UserData
UserData run-time property

property TOvcBaseEntryField.UserData : TOvcUserData

Default: OvcUserData

UserData determines which TOvcUserData object the field uses for user-defined mask and substitution characters.


TOvcBaseEntryField.ValidateSelf
ValidateSelf method

function TOvcBaseEntryField.ValidateSelf : Boolean;

ValidateSelf validates the field contents while the field still has the focus.

If a method is assigned to the OnUserValidation event, that method is automatically called when the focus leaves the field. ValidateSelf is provided in case you need to validate the field contents manually before the focus leaves the field. If the field contents are invalid, ValidateSelf returns False.

See also: IsValid, OnUserValidation


TOvcBaseEntryField.events
TOvcBaseEntryField events

OnChange 	OnKeyDown

OnClick 	OnKeyPress

OnDblClick 	OnKeyUp

OnDragDrop 	OnMouseDown

OnDragOver 	OnMouseMove

OnEndDrag 	OnMouseUp

OnEnter 	OnUserCommand

OnError 	OnUserValidation

OnExit


TOvcBaseEntryField.methods
TOvcBaseEntryField methods

AlignControls 	InheritsFrom

Assign	InitInstance

AssignTo 	InsertComponent

BeginDrag	InsertControl

BringToFront	InstanceSize

Broadcast	Invalidate

CanFocus	IsControlMouseMsg

ChangeName 	IsValid

ChangeScale 	KeyDown

ClassInfo	KeyPress

ClassName	KeyUp

ClassParent	Loaded

ClassType	MainWndProc

ClearContents	MergeWithPicture

ClearSelection	MethodAddress

Click 	MethodName

ClientToScreen	MouseDown

ContainsControl	MouseMove

ControlAtPos	MouseUp

CopyToClipboard	MoveCaret

Create	NewInstance

CreateHandle 	NotifyControls

CreateSubClass 	PaintControls

CreateWindowHandle 	PaintHandler

CutToClipboard	PaintWindow

DblClick 	PaletteChanged

DecreaseValue	PasteFromClipboard

DefaultHandler 	Perform

Destroy	ReadState

DestroyComponents	Realign

DestroyHandle 	RecreateWnd

Destroying	Refresh

DestroyWindowHandle 	RemoveComponent

DestroyWnd 	RemoveControl

DisableAlign	Repaint

Dispatch	Restore

DoEnter 	ScaleBy

DoExit 	ScaleControls

DoKeyDown 	ScreenToClient

DoKeyPress 	ScrollBy

DoKeyUp 	SelectAll

DragCanceled 	SelectFirst

Dragging	SelectNext

EnableAlign	SendToBack

EndDrag	SetBounds

FieldAddress	SetDesigning

FieldIsEmpty	SetFocus

FindComponent	SetInitialValue

FindNextControl 	SetParent

Focused	SetRangeHi

Free	SetRangeLo

FreeInstance	SetSelection

GetClientOrigin 	SetTextBuf

GetClientRect 	SetValue

GetDeviceContext 	SetZOrder

GetPalette 	Show

GetStrippedEditString	ShowControl

GetTabOrderList	Update

GetTextBuf	UpdateBoundsRect

GetTextLen	ValidateRename

GetValue	ValidateSelf

HandleAllocated	VisibleChanging

HandleNeeded	WndProc

HasParent 	WriteComponents

Hide	WriteState

IncreaseValue


TOvcBaseEntryField.properties
TOvcBaseEntryField properties

Align 	EverModified

AsBoolean 	Font

AsCents 	ForceInsert

AsDateTime 	ForceOvertype

AsExtended 	Handle

AsFloat 	Height

AsInteger 	HelpContext

AsOvcDate 	HighlightColors

AsOvcTime 	Hint

AsString 	InputRequired

AutoAdvanceChar 	InsertPushes

AutoAdvanceLeftRight 	IntlSupport

AutoAdvanceUpDown 	IsControl

AutoSelect  	LastError

AutoSize  	Left

BeepOnError 	MaxLength

BorderStyle  	Modified

BoundsRect 	MouseCapture

Brush 	Name

Canvas  	Owner

Caption  	PadChar

CaretIns 	Parent

CaretOvr  	ParentColor

CaretToEnd  	ParentCtl3D

ClientHeight 	ParentFont

ClientOrigin 	ParentShowHint

ClientRect 	PasswordChar

ClientWidth 	PasswordMode

Color 	PopupMenu

ComponentCount 	RangeHi

ComponentIndex 	RangeLo

Components 	ReadOnly

ComponentState 	RightJustify

ControlCharColor  	SelectedText

ControlCount 	SelectionLength

Controller  	SelectionStart

Controls 	ShowHint

ControlState 	Showing

ControlStyle 	SoftValidation

Ctl3D  	StripLiterals

CurrentPos 	TabOrder

Cursor	TabStop

DataSize 	Tag

DecimalPlaces  	Text

DefWndProc  	Top

DesignInfo 	TrimBlanks

DisplayString 	Uninitialized

DragCursor  	UserData

DragMode  	Visible

EditString 	Width

Enabled 	WindowHandle

ErrorColors


TOvcBaseSpinner
TOvcBaseSpinner class

See also: properties, events, methods, hierarchy

Class Overview

The TOvcBaseSpinner is an abstract class, so you will never instantiate an instance of this class. You must either derive your own class from TOvcBaseSpinner, or use one of the other three classes derived from it (TOvcSpinner, TOvcFourWaySpinner, or TOvcStarSpinner). In most cases, you will probably take the latter course.

Orpheus provides three spinner components that allow adjustments to be made to field values using the mouse. The spinner components connect or "dock" with another component to inform the component about the state of the spinner buttons. They also have the capability to repeat when the spin button is held down. The auto-repeat capability is optional and the acceleration (how fast the speed of the notification messages increases) is adjustable.

The Orpheus spinner components additionally support the ability to switch spin buttons while one is depressed by dragging the mouse cursor over another spin button. They use scaleable button designs that allow them to be used with fields of any reasonable height.

The TOvcSpinner component is a two button spinner that provides up and down adjustment of an associated field, auto-repeat, and automatic value wrapping capabilities.

The TOvcFourWaySpinner component provides all the features of the TOvcSpinner, plus left and right spin buttons. It is useful for first positioning the caret within a subfield of a field (e.g., a date field) using the left/right spin buttons and then adjusting the subfield value with the up/down spin buttons.

The TOvcStarSpinner component provides five-way control with left/right and up/down spin buttons, and a center button. The center button is useful for selecting a special popup function such as a calendar attached to a date field.


TOvcBaseSpinner hierarchy


TOvcBaseSpinner.Acceleration
Acceleration property

property TOvcBaseSpinner.Acceleration : Byte

Default: 5

Acceleration determines how fast the speed of the notification events is increased.

Valid values range from 0 (for no acceleration) to 10 (for the fastest acceleration). Acceleration is not used if the AutoRepeat property is False.

See also: AutoRepeat


TOvcBaseSpinner.AutoRepeat
AutoRepeat property

property TOvcBaseSpinner.AutoRepeat : Boolean

Default: True

AutoRepeat determines whether notification messages are repeated when the spin button is held down.

If AutoRepeat is True, clicking and holding one of the spin buttons causes multiple notifications to be generated. The frequency of the notifications increases the longer the spin button is held down. The Acceleration property determines how fast the frequency increases.

When a spin button is clicked and held, moving the mouse over another spin button changes the information sent in the notification to reflect the new button, but does not interrupt the current auto-repeat behavior. Moving the mouse cursor completely off of the spin component temporarily suspends notifications. Moving the mouse cursor back over one of the spin buttons resumes the notifications for that spin button.

The center button of a star spinner does not generate multiple notifications.

See also: Acceleration, FocusedControl, OnClick


TOvcBaseSpinner.Delta
Delta property

property TOvcBaseSpinner.Delta : Double

Default: 1

Delta determines the value sent with each notification.

This property determines the value that is sent as part of the OnClick or focused control notification. The value assigned to Delta normally represents the amount by which the field value should be changed.

See also: FocusedControl, OnClick


TOvcBaseSpinner.FocusedControl
FocusedControl property

property TOvcBaseSpinner.FocusedControl : TWinControl

FocusedControl is the control that receives notification that a spin button is pressed.

If FocusedControl is assigned to any of the Orpheus entry field components, notification of spin button presses is automatic (except for the center button on a star spinner). If the focused control is not an Orpheus entry field component, you can assign a method to the OnClick event. The method must respond to the spin notifications in a way that is appropriate for the focused control.

The local menu (viewed by right-clicking the selected spin component) contains four "dock with control" items that adjust the size and position of the spin component so that it is aligned with one edge of the focused control.

If you reposition the focused control or the spin component after docking, you must select the docking menu item again. The spin component doesn't automatically re-dock with the focused control.

When you dock the spin component with the focused control, ForceOddSize is set to False. This is because the spin component's height is adjusted to the height of its focused control, which might not be an odd value.

See also: AutoRepeat, ForceOddSize, OnClick


TOvcBaseSpinner.ForceOddSize
ForceOddSize property

property TOvcBaseSpinner.ForceOddSize : Boolean

Default: True

ForceOddSize determines whether the height and width of the spin component are adjusted so that they are an odd number of pixels.

Very small spin components can appear to have different sized buttons if the height and width of the spin component are an even number of pixels. If ForceOddSize is True, the height and width of the spin component are forced to be an odd number of pixels so that the spin buttons are the same height and width.

When you dock the spin component with its focused control, ForceOddSize is set to False. This is because the spin component's height is adjusted to the height of its focused control, which might not be an odd value.

See also: FocusedControl


TOvcBaseSpinner.OnClick
OnClick event

property TOvcBaseSpinner.OnClick : TSpinClickEvent

TSpinClickEvent = procedure(Sender : TObject; State : TSpinState; Delta : Double; Wrap : Boolean) of object;

TSpinState = (ssNone, ssNormal, ssUpBtn, ssDownBtn, ssLeftBtn, ssRightBtn, ssCenterBtn);

OnClick defines an event handler that is called when one of the spin buttons is pressed.

The OnClick event is generated when one of the spin buttons is pressed. It is generated repetitively if the AutoRepeat property is True (for all buttons except the center button of a star spinner). The Delta parameter is the value assigned to the Delta property. State is one of the following values:

ssUpBtn - The top spin button was pressed.

ssDownBtn - The bottom spin button was pressed.

ssLeftBtn - The left spin button was pressed.

ssRightBtn - The right spin button was pressed.

ssCenterBtn - The center button was pressed.

The spinner component knows if it is attached (using the FocusedControl property) to one of the Orpheus entry field components, and automatically sends the information to that component. However, you can still assign a method to the OnClick event and take additional actions.

The following example demonstrates using a spin component to increase or decrease the value displayed in a standard TEdit control by responding to spin click events from OvcSpinner1.

procedure TForm1.OvcSpinner1Click(Sender : TObject; State : TSpinState;

                                  Delta : Double; Wrap : Boolean);

var

  C : Integer;

  R : Double;

begin

  Val(Edit1.Text, R, C);

  if C = 0 then begin

    case State of

      ssUpBtn   : R := R + Delta;

      ssDownBtn : R := R - Delta;

    end;

    Edit1.Text := Format('%8.2f', [R]);

  end else

    Edit1.Text := '(Error)'

end;

...

OvcSpinner1.OnClick := OvcSpinner1Click;

See also: AutoRepeat, Delta


TOvcBaseSpinner.WrapMode
WrapMode property

property TOvcBaseSpinner.WrapMode : Boolean

Default: True

WrapMode determines whether spinner values wrap when they reach the upper or lower limits.

For example, assume you are using a spin component to increase and decrease the value of a Byte field and Delta is 1. If WrapMode is True and the value is increased past 255, the field value is wrapped to 0. Conversely, if the value is decreased below 0, the field value is wrapped to 255.

See also: Delta


TOvcBaseSpinner.events
TOvcBaseSpinner events

OnClick	OnKeyDown

OnDblClick 	OnKeyPress

OnDragDrop 	OnKeyUp

OnDragOver 	OnMouseDown

OnEndDrag 	OnMouseMove

OnEnter 	OnMouseUp

OnExit


TOvcBaseSpinner.methods
TOvcBaseSpinner methods

AlignControls 	Hide

Assign	InheritsFrom

AssignTo 	InitInstance

BeginDrag	InsertComponent

BringToFront	InsertControl

Broadcast	InstanceSize

CanFocus	Invalidate

ChangeName 	IsControlMouseMsg

ChangeScale 	KeyDown

ClassInfo	KeyPress

ClassName	KeyUp

ClassParent	Loaded

ClassType	MainWndProc

Click 	MethodAddress

ClientToScreen	MethodName

ContainsControl	MouseDown

ControlAtPos	MouseMove

Create	MouseUp

CreateHandle 	NewInstance

CreateSubClass 	NotifyControls

CreateWindowHandle 	Paint

DblClick 	PaintControls

DefaultHandler 	PaintHandler

DefineProperties 	PaintWindow

Destroy	PaletteChanged

DestroyComponents	Perform

DestroyHandle 	ReadState

Destroying	Realign

DestroyWindowHandle 	RecreateWnd

DestroyWnd 	Refresh

DisableAlign	RemoveComponent

Dispatch	RemoveControl

DoEnter 	Repaint

DoExit 	ScaleBy

DoKeyDown 	ScaleControls

DoKeyPress 	ScreenToClient

DoKeyUp 	ScrollBy

DragCanceled 	SelectFirst

Dragging	SelectNext

EnableAlign	SendToBack

EndDrag	SetBounds

FieldAddress	SetDesigning

FindComponent	SetFocus

FindNextControl 	SetName

Focused	SetParent

Free	SetTextBuf

FreeInstance	SetZOrder

GetClientOrigin 	Show

GetClientRect 	ShowControl

GetDeviceContext 	Update

GetPalette 	UpdateBoundsRect

GetTabOrderList	ValidateRename

GetTextBuf	VisibleChanging

GetTextLen	WndProc

HandleAllocated	WriteComponents

HandleNeeded	WriteState

HasParent


TOvcBaseSpinner.properties
TOvcBaseSpinner properties

Acceleration	Font

Align 	ForceOddSize

AutoRepeat	Handle

BoundsRect 	Height

Brush 	HelpContext

Canvas  	Hint

Caption  	IsControl

ClientHeight 	Left

ClientOrigin 	MouseCapture

ClientRect 	Name

ClientWidth 	Owner

Color  	Parent

ComponentCount 	ParentColor

ComponentIndex 	ParentCtl3D

Components 	ParentFont

ComponentState 	ParentShowHint

ControlCount 	PopupMenu

Controls   	ShowHint

ControlState 	Showing

ControlStyle 	TabOrder

Ctl3D  	TabStop

Cursor	Tag

DefWndProc  	Text

Delta	Top

DesignInfo 	Visible

DragCursor  	Width

DragMode  	WindowHandle

Enabled	WrapMode

FocusedControl


TOvcBaseTableCell
TOvcBaseTableCell class

See also: properties, methods, events, hierarchy

Class Overview

The TOvcBaseTableCell class is the ancestor to the Orpheus table cell types. All cells in the table use instances of this class and its descendants to display and edit the table data. This is a true abstract ancestor. You should not create any instances of this class, but use one of the descendants instead. There is one special class that is an ancestor to this one, TOvcTableCellAncestor, but it only exists for referencing a cell type across the separate Orpheus Table units.

The TOvcBaseTableCell class is described here because if you define any cell descendants you will need know about the flow of data between a cell and its owning table. You might even have to descend from this class rather than its two main children, the TOvcTCBaseString class (for string cells) and the TOvcTCBaseBitMap (for bitmap cells).

A cell object belongs to only one table. You cannot share cell objects between tables. However, a table can use the same cell object many times, through different references. For example, two columns could use the same cell object as their default cell. Every time a cell is linked to a table (no matter through which route) its reference count is incremented. Similarly, every time a cell object link is broken, the reference count is decremented. When the count is zero, the cell object is not linked to the table at all (and the internal pointer to the table is reset). For example, deleting a column causes the column object to be destroyed, and the column's destructor decrements the default cell object's reference count. Setting a default cell for a column causes the current default cell's reference count to be decremented and the new cell's reference count to be incremented.

A cell object stores the display information for the cells it refers to. It does not store the actual data. The table provides the cell object's paint method with a pointer to the data to display when the cell is painted. For example, if the table is repainting column 3, the cell object is called to paint the cell at row 0 column 3 with the data for that cell, and then it is called to paint the cell at row 1 column 3 with the data for that cell, and so on. The display information that a cell object stores is the background color, font data, access rights (normal, read-only, invisible), and adjustment attribute (where to paint the data in the cell).

Although a cell object has the color, font, and display information, they are only treated as defaults. The table can override the cell object's display information (for example, the cell could be in a locked part of the table, and hence have a different color and font). To determine the actual display information for a cell address, the cell interrogates the table for any overrides and supplies its own values as defaults (see the ResolveAttributes method). In addition, the table publishes an event that also gets triggered so you can even install a handler to override the display information provided by the table. When a cell needs to be painted, the process is:

1.  The table calls the cell object's ResolveAttributes method.

2.  ResolveAttributes builds a record with the default display information for the cell object. It then calls a method of the table so that the table gets a chance to override any or all of this data.

3.  If you have one installed, this method of the table calls your event handler, which can override any or all of the display information.

4.  ResolveAttributes makes sure that any default values still present are set properly.

When the user edits data in a cell, the table calls the StartEditing method in the cell object to start the editing process. StartEditing must create a control (or activate it if it is pre-created but quiescent and hidden) that actually edits the data. The editing control must be a windowed control (it must have a window handle). The table makes sure that this editing control is placed properly over the cell, that it gets the focus when required, and that it is hidden or visible when necessary (it does some of this through methods of the cell object). The editing control must pass all the keystrokes it receives through the WM_KEYDOWN message to the table. The table categorizes the keystroke message into one of three sets:

•  The keystroke must be processed by the table (for example, <Esc> to abandon editing the cell). The original message is ignored by the editing control and it is passed back to the table.

•  The keystroke could be processed by the table if the editing control does not recognize it (for example, <PgDn> is not used in a normal Windows single-line edit control, but the table uses it to page the table data down). The editing control must decide whether to process the message itself or pass it back to the table.

•  The keystroke would be ignored by the table anyway. The editing control is free to take any action on the keystroke.

When the table determines that the editing session is over for the cell (for example, the user clicks elsewhere in the table), the CanStopEditing method of the cell object is called. The cell object must determine, in conjunction with its editing control, whether the editing session can stop. Generally this means a test to see if the edited data is valid. If it is, CanStopEditing returns True, and the table calls the StopEditing method, which causes the cell object to save the edited data (if required) and destroy or hide the editing control.


TOvcBaseTableCell hierarchy


TOvcBaseTableCell.Access
Access property

property TOvcBaseTableCell.Access : TOvcTblAccess

TOvcTblAccess = (otxDefault, otxNormal, otxReadOnly, otxInvisible);

Default: otxDefault

Access determines the cell access rights.

The possible values for Access are:

otxDefault - The cell takes its access rights from the table.

otxNormal - The cell can be read and edited.

otxReadOnly - The cell can be read but not edited.

otxInvisible - The cell cannot be read or edited and is invisible (the cell is displayed as a blank rectangle in the background color).

The table can override the value of Access at run time when displaying or editing a cell. A call to ResolveAttributes determines the correct value at run time. If you want the cell to have the table's access rights value, use otxDefault.

See also: Adjust, Color, Font, ResolveAttributes


TOvcBaseTableCell.Adjust
Adjust property

property TOvcBaseTableCell.Adjust : TOvcTblAdjust

TOvcTblAdjust = otaDefault, otaTopLeft, otaTopCenter, otaTopRight, otaCenterLeft, otaCenter, otaCenterRight, otaBottomLeft, otaBottomCenter, otaBottomRight);

Default: otaDefault

Adjust defines where the data is displayed in the cell.

The possible values for Adjust are:

otaDefault - The cell takes its adjustment value from the table.

otaTopLeft - The data is displayed in the top left corner of the cell.

otaTopCenter - The data is centered horizontally at the top of the cell.

otaTopRight - The data is displayed in the top right corner of the cell.

otaCenterLeft - The data is centered vertically at the left of the cell.

otaCenter - The data is centered vertically and horizontally in the cell.

otaCenterRight - The data is centered vertically at the right of the cell.

otaBottomLeft - The data is displayed in the bottom left corner of the cell.

otaBottomCenter - The data is centered horizontally at the bottom of the cell.

otaBottomRight - The data is displayed in the bottom right corner of the cell.

The table can override the value of Adjust at run time when displaying or editing a cell. A call to ResolveAttributes determines the correct value at run time. If you want the cell to have the table's adjustment value, use otaDefault.

See also: Access, Color, Font, ResolveAttributes


TOvcBaseTableCell.CanStopEditing
CanStopEditing virtual method

function TOvcBaseTableCell.CanStopEditing(SaveValue : Boolean) : Boolean; virtual;

CanStopEditing determines whether the edited data is valid and editing can be stopped.

CanStopEditing is called by the table when the user is finished editing the cell. This method gives the cell object a chance to make sure that the edited data is valid. SaveValue is True if the edited data will be saved, or False if the edited data will be discarded. CanStopEditing can use this value to determine whether to do any validation or not. It can display a warning or error message box if appropriate.

If the data is valid and can be saved, CanStopEditing returns True. The table then calls the cell object's StopEditing method to save the data. If the data is invalid, CanStopEditing returns False. The table then retransfers focus to the editing control so that the user can correct the problem.

The default implementation of CanStopEditing always returns True.

The following example shows how CanStopEditing could be written for a cell that uses a TEdit-based editing control for entering a numeric field.

function TMyCellComponent.CanStopEditing(SaveValue : Boolean) : Boolean;

  var V, ec : Integer;

  begin

    Result := True;

    if SaveValue then

      begin

        {CellEditor is a TEdit descendant}

        Val(CellEditor.Text, V, ec);

        if (ec <> 0) then

          {the text in the edit field is not numeric}

          Result := False;

      end;

  end;

See also: StartEditing, StopEditing


TOvcBaseTableCell.Color
Color property

property TOvcBaseTableCell.Color : TColor

Default: clBtnFace

Color is the background color for the cell.

The table can override this value at run time when displaying or editing a cell. A call to ResolveAttributes determines the correct value at run time.

To use the table's color as the background color, set the TableColor property to True.

See also: Access, Adjust, Font, ResolveAttributes, TableColor


TOvcBaseTableCell.DecRefs
DecRefs method

procedure TOvcBaseTableCell.DecRefs;

DecRefs decrements the reference count.

This routine is called when a cell object is unlinked from a table or from an object that belongs to a table (for example, a column). The number of references is decremented by one. If it reaches zero, then the internal pointer to the table is set to nil.

For an example of how to use DecRefs, see the IncRefs method.

See also: IncRefs, References


TOvcBaseTableCell.EditHandle
EditHandle abstract method

function TOvcBaseTableCell.EditHandle : THandle; virtual; abstract;

EditHandle returns the handle of the editing control.

When you create a descendant of a cell component, this method must be overridden.

EditHandle is called between a call to StartEditing and a call to StopEditing. It is called by the table to obtain the handle of the editing control.


TOvcBaseTableCell.EditHide
EditHide abstract method

procedure TOvcBaseTableCell.EditHide; virtual; abstract;

EditHide hides the editing control.

When you create a descendant of a cell component, this method must be overridden.

EditHide is called between a call to StartEditing and a call to StopEditing. It is called by the table to hide the editing control. It could be used when the user is viewing a page of the table where the cell being edited is not present.

The following example shows how the EditHide method is implemented for a normal cell component, in this case a TOvcTCCustomGlyph component. FEdit is the cell editor object. The call to the Windows API SetWindowPos routine causes the cell editor object to be hidden.

procedure TOvcTCCustomGlyph.EditHide;

  begin

    if Assigned(FEdit) then

      with FEdit do

        WinProcs.SetWindowPos(Handle, HWND_TOP, 0, 0, 0, 0,

                              SWP_HIDEWINDOW or SWP_NOREDRAW or SWP_NOZORDER);

  end;

See also: EditMove


TOvcBaseTableCell.EditMove
EditMove abstract method

procedure TOvcBaseTableCell.EditMove(CellRect : TRect); virtual; abstract;

EditMove moves, resizes, and shows the editing control.

When you create a descendant of a cell component, this method must be overridden.

EditMove is called between a call to StartEditing and a call to StopEditing. It is called by the table to resize and move the editing control over the cell that is being edited. The cell object must resize and move the editing control and make it visible, if necessary. If this doesn't occur, the underlying cell is not repainted.

The following example shows how the EditMove method is implemented for a normal cell component, in this case a TOvcTCCustomGlyph component. FEdit is the cell editor object. The call to the Windows API SetWindowPos routine causes the cell editor to be moved to the given rectangle, grown (or shrunk) to fit and to be shown. The calls to InvalidateRect and UpdateWindow force the cell editor to repaint itself.

procedure TOvcTCCustomGlyph.EditMove(CellRect : TRect);

  var

    EditHandle : HWND;

  begin

    if Assigned(FEdit) then begin

      EditHandle := FEdit.Handle;

      with CellRect do

        WinProcs.SetWindowPos(EditHandle, HWND_TOP,

                              Left, Top, Right-Left, Bottom-Top,

                              SWP_SHOWWINDOW or SWP_NOREDRAW or SWP_NOZORDER);

      InvalidateRect(EditHandle, nil, false);

      UpdateWindow(EditHandle);

    end;

  end;

See also: EditHide


TOvcBaseTableCell.FilterTableKey
FilterTableKey virtual method

function TOvcBaseTableCell.FilterTableKey(var Msg : TWMKey) : TOvcTblKeyNeeds; virtual;

TOvcTblKeyNeeds = (otkDontCare, otkWouldLike, otkMustHave);

FilterTableKey passes the keystroke message to the table for filtering.

The editing control calls its cell object's FilterTableKey for each WM_KEYDOWN message that it receives. FilterTableKey then calls a method called FilterKey in the cell's owning table. The table decides whether it wants the keystroke or whether it would allow the cell's editing control to use it. The return values are:

otkDontCare - The table does not use the key and would ignore it anyway.

otkWouldLike - The table does use the key, but is willing to let the editing control decide whether it wants it or not.

otkMustHave - The table must have the keystroke.

The editing control can ignore the otkMustHave replies, and use the keystroke as it sees fit. However, the only two keystrokes in the "must have" category are <Esc> (abandon cell edit) and <F2> (save the data and stop editing), and to ignore these would imperil the standard user interface for the table.

The otkWouldLike category includes keys like the arrow keys and paging keys. Of course, the editing control could use some of these anyway. For example, when the right arrow key is used in a normal Windows edit control, you expect to move between characters in the string and not between cells.

Once the editing control gets a reply from the table, it can pass the message to the table for actual processing by calling SendKeyToTable.

The following example shows how the FilterTableKey method is implemented in the TOvcBaseTableCell class. This is generally sufficient for most cell components. FTable is the internal field to TOvcBaseTableCell that holds the owning table. Since FTable is of type TOvcTableAncestor (which has no explicit methods), it must be typecast to a TOvcTable first.

function TOvcBaseTableCell.FilterTableKey(var Msg : TWMKey) : TOvcTblKeyNeeds;

  begin

    if not Assigned(FTable) then

      Result := otkDontCare

    else

      Result := TOvcTable(FTable).FilterKey(Msg);

  end;

See also: SendKeyToTable


TOvcBaseTableCell.Font
Font property

property TOvcBaseTableCell.Font : TFont

Default: the standard font defined by Delphi

Font is the font for string data displayed in the cell.

The table can override this value at run time when displaying or editing a cell. A call to ResolveAttributes determines the correct value at run time. This property only makes sense for string type cell components.

See also: Access, Adjust, Color, ResolveAttributes, TableFont


TOvcBaseTableCell.IncRefs
IncRefs method

procedure TOvcBaseTableCell.IncRefs;

IncRefs increments the reference count.

This method is called when a cell object is linked to a table or to an object that belongs to a table. For example, when the DefaultCell property for a new column is set, the IncRefs method for the cell component that is being used is called. If the References property for the cell component was 0 before the call, this is the first time that this cell has been used by a table and it is up to the calling routine to set the Table property for the cell to link it to the correct table.

The classes that make up the Orpheus table call this method when required. It is documented in case you need to add extra functionality to a descendant of a TOvcTable.

The following example shows how the IncRefs and DecRefs methods are used in the write access method for the DefaultCell property of the TOvcTableColumn class. FDelCell is the field "behind" the DefaultCell property. C is the new cell component to which DefaultCell is being set.

if Assigned(FDefCell) then

  FDefCell.DecRefs;

FDefCell := C;

if Assigned(FDefCell) then begin

  if (FDefCell.References = 0) then begin

    FDefCell.Table := FTable;

    {...}

  end;

  FDefCell.IncRefs;

end;

See also: DecRefs, References


TOvcBaseTableCell.Margin
Margin property

property TOvcBaseTableCell.Margin : Integer

Default: 4

Margin is the number of pixels to leave between the data drawn in the cell and the cell boundaries.

The cell object's Paint method uses this value to position the data within the cell. The margin value is used in conjunction with the Adjust property to determine where to draw the data.

If Adjust is:	The margin applies to:

otaTopLeft	the top and left sides

otaCenterLeft	the left side

otaBottomLeft	the bottom and left sides

otaTopCenter	the top

otaCenter	margin is ignored

otaBottomCenter	the bottom

otaTopRight	top and right sides

otaCenterRight	the right side

otaBottomRight	the bottom and right sides

The property's write method ensures that Margin is zero or positive; no exception is generated however.

See also: Adjust, Paint


TOvcBaseTableCell.OnClick
OnClick event

property TOvcBaseTableCell.OnClick : TNotifyEvent

Provides an OnClick event for the cell component's editing control.

The OnClick event applies to the editing control when it is created, not to the cell component itself (the cell component has no visual

representation at run-time). The StartEditing method will, once it has created the editing control, set its OnClick event handler equal to the cell component's OnClick event handler so that the editing control can trigger the required event.

The event has the same meaning as for the normal Delphi components. For futher information, see the OnClick event in the Delphi help.


TOvcBaseTableCell.OnDblClick
OnDblClick event

property TOvcBaseTableCell.OnDblClick : TNotifyEvent

Provides an OnDblClick event for the cell component's editing control.

The OnDblClick event applies to the editing control when it is created, not to the cell component itself (the cell component has no visual

representation at run-time). The StartEditing method will, once it has created the editing control, set its OnDblClick event handler equal to the cell component's OnDblClick event handler so that the editing control can trigger the required event.

The event has the same meaning as for the normal Delphi components. For futher information, see the OnDblClick event in the Delphi help.


TOvcBaseTableCell.OnDragDrop
OnDragDrop event

property TOvcBaseTableCell.OnDragDrop : TDragDropEvent

Provides an OnDragDrop event for the cell component's editing control.

The OnDragDrop event applies to the editing control when it is created, not to the cell component itself (the cell component has no visual representation at run-time). The StartEditing method will, once it has created the editing control, set its OnDragDrop event handler equal to the cell component's OnDragDrop event handler so that the editing control can trigger the required event.

The event has the same meaning as for the normal Delphi components. For futher information, see the OnDragDrop event in the Delphi help.


TOvcBaseTableCell.OnDragOver
OnDragOver event

property TOvcBaseTableCell.OnDragOver : TDragDropEvent

Provides an OnDragOver event for the cell component's editing control.

The OnDragOver event applies to the editing control when it is created, not to the cell component itself (the cell component has no visual representation at run-time). The StartEditing method will, once it has created the editing control, set its OnDragOver event handler equal to the cell component's OnDragOver event handler so that the editing control can trigger the required event.

The event has the same meaning as for the normal Delphi components. For futher information, see the OnDragOver event in the Delphi help.


TOvcBaseTableCell.OnEndDrag
OnEndDrag event

property TOvcBaseTableCell.OnEndDrag : TEndDragEvent

Provides an OnEndDrag event for the cell component's editing control.

The OnEndDrag event applies to the editing control when it is created, not to the cell component itself (the cell component has no visual representation at run-time). The StartEditing method will, once it has created the editing control, set its OnEndDrag event handler equal to the cell component's OnEndDrag event handler so that the editing control can trigger the required event.

The event has the same meaning as for the normal Delphi components. For futher information, see the OnEndDrag event in the Delphi help.


TOvcBaseTableCell.OnEnter
OnEnter event

property TOvcBaseTableCell.OnEnter : TNotifyEvent

Provides an OnEnter event for the cell component's editing control.

The OnEnter event applies to the editing control when it is created, not to the cell component itself (the cell component has no visual representation at run-time). The StartEditing method will, once it has created the editing control, set its OnEnter event handler equal to the cell component's OnEnter event handler so that the editing control can trigger the required event.

The event has the same meaning as for the normal Delphi components. For futher information, see the OnEnter event in the Delphi help.


TOvcBaseTableCell.OnExit
OnExit event

property TOvcBaseTableCell.OnExit : TNotifyEvent

Provides an OnExit event for the cell component's editing control.

The OnExit event applies to the editing control when it is created, not to the cell component itself (the cell component has no visual representation at run-time). The StartEditing method will, once it has created the editing control, set its OnExit event handler equal to the cell component's OnExit event handler so that the editing control can trigger the required event.

The event has the same meaning as for the normal Delphi components. For futher information, see the OnExit event in the Delphi help.


TOvcBaseTableCell.OnKeyDown
OnKeyDown event

property TOvcBaseTableCell.OnKeyDown : TKeyEvent

Provides an OnKeyDown event for the cell component's editing control.

The OnKeyDown event applies to the editing control when it is created, not to the cell component itself (the cell component has no visual representation at run-time). The StartEditing method will, once it has created the editing control, set its OnKeyDown event handler equal to the cell component's OnKeyDown event handler so that the editing control can trigger the required event.

The event has the same meaning as for the normal Delphi components. For futher information, see the OnKeyDown event in the Delphi help.


TOvcBaseTableCell.OnKeyPress
OnKeyPress event

property TOvcBaseTableCell.OnKeyPress : TKeyPressEvent

Provides an OnKeyPress event for the cell component's editing control.

The OnKeyPress event applies to the editing control when it is created, not to the cell component itself (the cell component has no visual representation at run-time). The StartEditing method will, once it has created the editing control, set its OnKeyPress event handler equal to the cell component's OnKeyPress event handler so that the editing control can trigger the required event.

The event has the same meaning as for the normal Delphi components. For futher information, see the OnKeyPress event in the Delphi help.


TOvcBaseTableCell.OnKeyUp
OnKeyUp event

property TOvcBaseTableCell.OnKeyUp : TKeyEvent

Provides an OnKeyUp event for the cell component's editing control.

The OnKeyUp event applies to the editing control when it is created, not to the cell component itself (the cell component has no visual representation at run-time). The StartEditing method will, once it has created the editing control, set its OnKeyUp event handler equal to the cell component's OnKeyUp event handler so that the editing control can trigger the required event.

The event has the same meaning as for the normal Delphi components. For futher information, see the OnKeyUp event in the Delphi help.


TOvcBaseTableCell.OnMouseDown
OnMouseDown event

property TOvcBaseTableCell.OnMouseDown : TMouseEvent

Provides an OnMouseDown event for the cell component's editing control.

The OnMouseDown event applies to the editing control when it is created, not to the cell component itself (the cell component has no visual representation at run-time). The StartEditing method will, once it has created the editing control, set its OnMouseDown event handler equal to the cell component's OnMouseDown event handler so that the editing control can trigger the required event.

The event has the same meaning as for the normal Delphi components. For futher information, see the OnMouseDown event in the Delphi help.


TOvcBaseTableCell.OnMouseMove
OnMouseMove event

property TOvcBaseTableCell.OnMouseMove : TMouseMoveEvent

Provides an OnMouseMove event for the cell component's editing control.

The OnMouseMove event applies to the editing control when it is created, not to the cell component itself (the cell component has no visual representation at run-time). The StartEditing method will, once it has created the editing control, set its OnMouseMove event handler equal to the cell component's OnMouseMove event handler so that the editing control can trigger the required event.

The event has the same meaning as for the normal Delphi components. For futher information, see the OnMouseMove event in the Delphi help.


TOvcBaseTableCell.OnMouseUp
OnMouseUp event

property TOvcBaseTableCell.OnMouseUp : TMouseEvent

Provides an OnMouseUp event for the cell component's editing control.

The OnMouseUp event applies to the editing control when it is created, not to the cell component itself (the cell component has no visual representation at run-time). The StartEditing method will, once it has created the editing control, set its OnMouseUp event handler equal to the cell component's OnMouseUp event handler so that the editing control can trigger the required event.

The event has the same meaning as for the normal Delphi components. For futher information, see the OnMouseUp event in the Delphi help.


TOvcBaseTableCell.Paint
Paint virtual method

procedure TOvcBaseTableCell.Paint(Canvas : TCanvas; RowNum : TRowNum; ColNum : TColNum; CellWidth, CellHeight : Integer; const CellAttr : TOvcCellAttributes; Data : Pointer); virtual;

Paint the cell in the table.

Canvas is where the cell should be painted. The method should paint the data in the rectangle (0, 0, CellWidth, CellHeight) of this canvas. It should not paint anywhere outside of this rectangle.

RowNum and ColNum are the row and column numbers of the cell being painted. They are not required explicitly by the routine, but are passed for reference purposes.

Data is a pointer to the data to be painted in the cell. You must typecast it to the required type. The Data pointer could be nil (this is especially true when the table is being edited in the IDE), and so the Paint method must allow for this possibility.

CellAttr is a fully resolved set of attributes for the current cell. The attributes are the access rights, adjustment value, background color, font, and font color. The table collates this information through a prior call to ResolveAttributes.

The default implementation of Paint just fills the rectangle with the background color from the CellAttr record. A descendant's Paint method should call the ancestor routine to prepare the cell's background.

TCellAttributes is defined as:

TOvcCellAttributes = record

  caAccess    : TOvcTblAccess;   {access rights}

  caAdjust    : TOvcTblAdjust;   {data adjustment}

  caColor     : TColor;          {background color}

  caFont      : TFont;           {text font}

  caFontColor : TColor;          {text color}

end;

See also: ResolveAttributes


TOvcBaseTableCell.References
References run-time read-only property

property TOvcBaseTableCell.References : Integer

References is the number of links between a cell and its table.

References is a read-only property. Its value is changed by IncRefs and DecRefs.

See also: DecRefs, IncRefs


TOvcBaseTableCell.ResolveAttributes
ResolveAttributes virtual method

procedure TOvcBaseTableCell.ResolveAttributes(RowNum : TRowNum; ColNum : TColNum; var CellAttr : TOvcCellAttributes); virtual;

ResolveAttributes calculates the attributes for a cell.

ResolveAttributes is called by the table when the cell needs painting or when it is about to be edited. The attributes are the access rights, adjustment value, background color, font, and font color.

ResolveAttributes first sets up the CellAttr record with the cell object's internal values and then calls the table's ResolveCellAttributes method. ResolveCellAttributes changes the relevant attributes for cases such as locked cells (which have a different color), when the cell object is deferring to the table for its access rights, or when there is an OnGetCellAttributes event handler set up for the table.

ResolveAttributes then makes sure that all fields are set up. If the access value is still otxDefault, it is reset to otxNormal. If the adjustment is still otaDefault, it is reset to otaCenterLeft. If the color is still clOvcDefaultTableColor ($2FFFFFF), it is reset to clBtnFace.

TCellAttributes is defined as:

TOvcCellAttributes = record

  caAccess    : TOvcTblAccess;   {access rights}

  caAdjust    : TOvcTblAdjust;   {data adjustment}

  caColor     : TColor;          {background color}

  caFont      : TFont;           {text font}

  caFontColor : TColor;          {text color}

end;


TOvcBaseTableCell.SendKeyToTable
SendKeyToTable method

procedure TOvcBaseTableCell.SendKeyToTable(var Msg : TWMKey);

SendKeyToTable sends a keystroke message to the table for processing.

The editing control for a cell object calls this method to send a WM_KEYDOWN message to the table. The editing control should have already called FilterTableKey for the message and received either an otkMustHave reply (the editing control must pass the message to the table for processing) or an otkWouldLike reply (the editing control can decide whether to pass the message on or not).

For example, assume that the editing control is a normal Windows edit control. If the caret is at the start of the string, pressing the left arrow could result in the active cell being changed to the cell immediately to the left, but anywhere else in the string would result in the caret moving position one character to the left (the normal processing for an edit control). The call to FilterTableKey returns otkWouldLike and the edit control then must determine where the caret is and call SendKeyToTable if it is at the start of the string.

The following example is extracted from the WM_KEYDOWN message handler for the editing control for a TOvcTCString cell. The method first sets up some defaults and calls the owning cell's FilterTableKey method (the owning cell is a field called CellOwner) to find out what importance the table places on the keystroke. If the table wants the keystroke (the return value is otkMustHave) then the editing control passes the keystroke right back to the table by calling SendKeyToTable. If the table would like the keystroke, the editing control makes a decision based on the keystroke. An example is given for <Left>: if the caret is at the start of the edited text and there is no selection, the table gets the keystroke. At the end of the routine, if the table did not use the keystroke, it is passed on to the editing control's window procedure by use of the inherited statement.

begin

  GridUsedIt := false;

  GridReply := otkDontCare;

  if (CellOwner <> nil) then

    GridReply := CellOwner.FilterTableKey(Msg);

  case GridReply of

    otkMustHave :

      begin

        CellOwner.SendKeyToTable(Msg);

        GridUsedIt := true;

      end;

    otkWouldLike :

      case Msg.CharCode of

        VK_LEFT :

          begin

            GetSelection(SStart, SEnd);

            if (SStart = SEnd) and (SStart = 0) then begin

              CellOwner.SendKeyToTable(Msg);

              GridUsedIt := true;

            end;

          end;

        ...other case selections...

      end;{case}

  end;{case}

  if not GridUsedIt then

    inherited;

end;

See also: FilterTableKey


TOvcBaseTableCell.StartEditing
StartEditing abstract method

procedure TOvcBaseTableCell.StartEditing(RowNum : TRowNum; ColNum : TColNum; CellRect : TRect; const CellAttr : TOvcCellAttributes; Data : Pointer); virtual; abstract;

StartEditing creates the editing control for the cell.

When you create a descendant of a cell component, this method must be overridden.

StartEditing should create (or show) the editing control for the cell. RowNum is the row number for the cell and ColNum is its column number. CellRect is the rectangle of the cell itself with respect to the table. Data is a pointer to the data.

CellAttr is a fully resolved set of attributes for the current cell. The attributes are access rights, adjustment value, background color, font, and font color. The table collates this information through a prior call to ResolveAttributes.

StartEditing should create a control that can edit the data. Specific properties for the control can be set as desired. The control's Parent should be the table itself, and CellRect should define the control's position and size.

StartEditing could save the row and column numbers in fields of the object if they are required during the editing process.

See also: ResolveAttributes, StopEditing


TOvcBaseTableCell.StopEditing
StopEditing abstract method

procedure TOvcBaseTableCell.StopEditing(SaveValue : Boolean; Data : Pointer); virtual; abstract;

StopEditing saves the data and destroys the editing control for the cell.

When you create a descendant of a cell component, this method must be overridden.

If SaveValue is True, StopEditing should save the edited data to the address specified by Data. After the data is saved, StopEditing must destroy (or hide) the editing control.

CanStopEditing is called before StopEditing. If CanStopEditing returns False, StopEditing is not called. If CanStopEditing returns True, StopEditing is called and must do its job because you cannot back out of the editing mode at that point.

See also: CanStopEditing, StartEditing


TOvcBaseTableCell.Table
Table property

property TOvcBaseTableCell.Table : TOvcTableAncestor

Table is the owning table.

If you use Table to change the table that owns the cell, the current table is notified that this cell is changing allegiance to another table. This causes all current links to the cell to be removed. Then the internal table pointer is set to the passed table, however the reference count remains at zero.

Ideally, you should use this property only to set the table to nil.


TOvcBaseTableCell.TableColor
TableColor property

property TOvcBaseTableCell.TableColor : Boolean

Default: True

TableColor indicates whether the background color of the cell is the same as the color of the table.

If you set TableColor to True, this instance's Color property is changed to match the Color property of the table. If you set TableColor to False, the Color property is not changed.

If the Color property for this instance is changed, TableColor is set to False.

If the Color property of the table is changed and TableColor is True, the Color property for this instance is changed to reflect the new Color value for the table. This happens only if the cell object is linked to a table.

Linking a cell to a table (changing its Table property) also causes the Color property for this instance to be modified if TableColor is True.

See also: Color, Table, TableFont


TOvcBaseTableCell.TableFont
TableFont property

property TOvcBaseTableCell.TableFont : Boolean

Default: True

TableFont indicates whether the font for the cell is the same as the font for the table.

If you set TableFont to True, this instance's Font property is changed to match the Font property of the table. If you set TableFont to False, the Font property is not changed.

If the Font property for this instance is changed, TableFont is set to False.

If the Font property of the table is changed and TableFont is True, the Font property for this instance is changed to reflect the new font value for the table. This happens only if the cell object is linked to a table.

Linking a cell to a table (by changing its Table property) also causes the Font property for this instance to be modified if TableFont is True.

See also: Color, Table, TableColor


TOvcBaseTableCell.TableWantsTab
TableWantsTab method

function TOvcBaseTableCell.TableWantsTab : Boolean;

TableWantsTab determines whether the owning table requires tab characters.

This method is called by the editing control to find out if the table requires tab characters to implement its "Tab to Arrow" feature. TableWantsTab returns True if the table requires the tab characters.

See also: TOvcTable.Options


TOvcBaseTableCell.events
TOvcBaseTableCell events

OnClick 	OnKeyDown

OnDblClick 	OnKeyPress

OnDragDrop 	OnKeyUp

OnDragOver 	OnMouseDown

OnEndDrag 	OnMouseMove

OnEnter 	OnMouseUp

OnExit


TOvcBaseTableCell.methods
TOvcBaseTableCell methods

Assign	HasParent

AssignTo 	IncRefs

CanStopEditing	InheritsFrom

ChangeName 	InitInstance

ClassInfo	InsertComponent

ClassName	InstanceSize

ClassParent	Loaded

ClassType	MethodAddress

Create	MethodName

DecRefs	NewInstance

DefaultHandler	Notification

DefineProperties 	Paint

Destroy	ReadState

DestroyComponents	RemoveComponent

Destroying	ResolveAttributes

Dispatch	SendKeyToTable

EditHandle	SetDesigning

EditHide	SetName

EditMove	StartEditing

FieldAddress	StopEditing

FilterTableKey	TableWantsTab

FindComponent	ValidateRename

Free	WriteComponents

FreeInstance	WriteState


TOvcBaseTableCell.properties
TOvcBaseTableCell properties

Access  	Margin

Adjust  	Name

Color  	Owner

ComponentCount 	References

ComponentIndex 	ShowHint

Components 	Table

ComponentState 	TableColor

DesignInfo 	TableFont

Font  	Tag

Hint


TOvcBaseViewer
TOvcBaseViewer class

See also: properties, events, methods, hierarchy

Class Overview

The TOvcBaseViewer is an abstract class, so you will never instantiate an instance of this class. You must either derive your own class from TOvcBaseViewer, or use one of the other two classes derived from it (TOvcTextFileViewer or TOvcFileViewer). In most cases, you will probably take the latter course.

When do you need to derive a new class from TOvcBaseViewer? When you want to use a viewer component to display textual data that is not stored in a file, or when you want to display only part(s) of a file rather than the entire file, or when the data in the file must be formatted before it can be displayed. For example, suppose that you want to use a viewer component to display the contents of a binary data file, and that the data is arranged into fixed-length records. Neither TOvcTextFileViewer nor TOvcFileViewer fit your needs, so you need to implement a new component derived from TOvcBaseViewer that does exactly what you want.

As far as the viewer component itself is concerned, there are only two things you must do in your TOvcBaseViewer descendant:

1.  Override the GetLinePtr method, which returns a pointer to a string representation of a given line

2.  Set the LineCount property to tell the viewer component how many lines to display.

Of course, in order to implement your GetLinePtr routine, you also need to implement a storage or retrieval mechanism to fetch the data for a given line and do whatever is necessary to convert that data to a displayable form.

The design and implementation of the storage/retrieval mechanism is entirely your responsibility. TOvcBaseViewer will neither help nor hinder you. But whatever you do, you need to do it fast. If you're reading data from disk in your GetLinePtr routine, you should design a buffering scheme to prevent excessive disk reads. If you're storing the data in a linked list, develop a scheme to minimize the distance that you search to locate a given node in the list (see the implementation of TOvcTextFileViewer's GetLinePtr routine). If you're formatting binary data, develop a scheme for buffering copies of pre-formatted strings to avoid formatting the same data repeatedly. The bottom line is that if your GetLinePtr routine can't respond rapidly to requests for text, the viewer component will perform sluggishly.


TOvcBaseViewer hierarchy


TOvcBaseViewer.ActualColumn
ActualColumn method

function TOvcBaseViewer.ActualColumn(Line : LongInt; EffectiveCol : Integer) : Integer;

ActualColumn converts an effective column to an actual column.

Given a Line number and an effective column position, this method returns the actual column position.

See also: EffectiveColumn


TOvcBaseViewer.BorderStyle
BorderStyle property

property TOvcBaseViewer.BorderStyle : TBorderStyle

Default: bsSingle

BorderStyle determines the style used when drawing the border.

The possible values are bsSingle (a single line border is drawn around the component) or bsNone (no border line).

The TBorderStyle type is defined in the Delphi Controls unit.


TOvcBaseViewer.Caret
Caret property

property TOvcBaseViewer.Caret : TOvcCaret

Default: vertical line caret

Caret determines the characteristics of the viewing caret.

This property allows you to customize the attributes of the viewer's caret.


TOvcBaseViewer.CaretActualPos
CaretActualPos run-time property

property TOvcBaseViewer.CaretActualPos : TOvcTextPos

CaretActualPos determines the actual caret position.

TOvcTextPos is defined as:

TOvcTextPos = record

  Line : LongInt;

  Col  : Integer;

end;

TOvcTextPos.Line is the line the caret is positioned on and TOvcTextPos.Col is the actual column the caret is positioned on. The actual column number indicates the position of the caret within the string, without regard for tab expansion.

See also: CaretEffectivePos


TOvcBaseViewer.CaretEffectivePos
CaretEffectivePos run-time property

property TOvcBaseViewer.CaretEffectivePos : TOvcTextPos

CaretEffectivePos determines the effective caret position.

TOvcTextPos is defined as:

TOvcTextPos = record

  Line : LongInt;

  Col  : Integer;

end;

TOvcTextPos.Line is the line the caret is positioned on and TOvcTextPos.Col is the effective column the caret is positioned on. The effective column number is the screen column at which the cursor would be placed given the contents of the string, the current TabSize, the state of the ExpandTabs property, and the actual column number.

See also: CaretActualPos, ExpandTabs, TabSize


TOvcBaseViewer.ClearMarker
ClearMarker method

procedure TOvcBaseViewer.ClearMarker(N : Byte);

ClearMarker clears the specified bookmark.

This method removes the bookmark specified by N. If the bookmark was displayed, the viewer is updated to erase the bookmark bitmap. Valid values for N are 0 to 9.

If the bookmark specified by N has not been set, no action is taken

See also: SetMarker, SetMarkerAt, ShowBookmarks


TOvcBaseViewer.CopyToClipboard
CopyToClipboard method

procedure TOvcBaseViewer.CopyToClipboard;

CopyToClipboard copies the selection to the Windows clipboard.

This method copies the currently selected text to the clipboard. If there is no selection, CopyToClipboard does nothing.

See also: GetSelection


TOvcBaseViewer.EffectiveColumn
EffectiveColumn method

function TOvcBaseViewer.EffectiveColumn(Line : LongInt; ActualCol : Integer) : Integer;

EffectiveColumn converts an actual column to an effective column.

Given a Line number and an actual column position, this method returns the effective column position.

See also: ActualColumn


TOvcBaseViewer.ExpandTabs
ExpandTabs property

property TOvcBaseViewer.ExpandTabs : Boolean

Default: True

ExpandTabs determines whether tab characters are expanded to spaces.

If this property is True, all tab characters are expanded to the number of spaces specified by the TabSize property. If ExpandTabs is False, tab characters are treated as ordinary characters (their appearance on screen depends on the font).

See also: TabSize


TOvcBaseViewer.FixedFont
FixedFont property

property TOvcBaseViewer.FixedFont : TOvcFixedFont

Default: FixedSys

FixedFont determines which font the viewer uses.

FixedFont performs the same function as the standard Font property, except that it limits the displayed fonts (in the Name sub-property) to only fixed-pitch fonts. This is because the viewer components support only fixed-pitch fonts.


TOvcBaseViewer.GetCaretPosition
GetCaretPosition method

function TOvcBaseViewer.GetCaretPosition(var Col : Integer) : LongInt;

GetCaretPosition returns the current position of the caret.

This method returns the current line number as the function result and the current column number in Col. The value returned in Col is an actual column number, not an effective column number.

See also: CaretActualPos, CaretEffectivePos, SetCaretPosition


TOvcBaseViewer.GetLine
GetLine method

function TOvcBaseViewer.GetLine(LineNum : LongInt; Dest : PChar; DestLen : Integer) : PChar;

GetLine returns the specified line.

GetLine returns the text of the line specified by LineNum. Dest is the buffer for the string and DestLen is its size (including the terminating null character). A pointer to Dest is returned as the function result. If the requested line is larger than DestLen, only DestLen-1 characters are returned.

The following example obtains a copy of the fifth line in the viewer in Buf and a pointer to Buf in P. Line numbers in the viewer are zero-based, so the fifth line is line number is 4.

var

  Buf : array[0..100] of Char;

  P   : PChar;

...

  P := GetLine(4, Buf, SizeOf(Buf));

See also: Lines


TOvcBaseViewer.GetLinePtr
GetLinePtr abstract method

function TOvcBaseViewer.GetLinePtr(LineNum : LongInt; var Len : Integer) : PChar; virtual; abstract;

GetLinePtr returns a pointer to the specified line.

This abstract method must be overridden in descendent classes to return a pointer to a null-terminated string corresponding to LineNum. The TOvcFileViewer and TOvcTextFileViewer components override this method, so if you use them, you don't have to override it.


TOvcBaseViewer.GetMarkerPosition
GetMarkerPosition method

function TOvcBaseViewer.GetMarkerPosition(N : Byte; var Col : Integer) : LongInt;

GetMarkerPosition returns the position of the specified bookmark.

This method returns the position of the bookmark specified by N. The column position is returned in Col and the line is returned as the function result. If the N'th bookmark is not set, GetMarkerPosition returns -1 for the function result. Valid values for N are 0 through 9.

The following example sets a bookmark at the current caret position and then retrieves its position, storing it in R and C:

var

  R : LongInt;

  C : Integer;

...

SetMarker(3);

R := GetMarkerPosition(3, C);

See also: SetMarker


TOvcBaseViewer.GetPrintableLine
GetPrintableLine method

function TOvcBaseViewer.GetPrintableLine(LineNum : LongInt; Dest : PChar; DestLen : Integer) : Integer;

GetPrintableLine returns a line suitable for printing.

This method returns the string at the line specified by LineNum in a format suitable for printing (i.e., with tabs expanded to spaces). Dest is the buffer for the string, and DestLen is its size. The function result indicates the length of the null-terminated string placed in Dest.

The following example shows how to use this method. S contains the text of line 1, with all tabs expanded, and SLen contains the length of the string.

var

  S    : array[0..1024] of Char;

  SLen : Integer;

...

  SLen := GetPrintableLine(1, S, SizeOf(S));

See also: Lines


TOvcBaseViewer.GetSelection
GetSelection method

function TOvcBaseViewer.GetSelection(var Line1 : LongInt; var Col1 : Integer; var Line2 : LongInt; var Col2 : Integer) : Boolean;

GetSelection returns True if any text is currently selected.

If the function result is True, the bounds of the selected region are the values returned in Line1, Col1, Line2, and Col2. Col1 and Col2 are actual column numbers. If False, there is no selected text in the viewer.

GetSelection is typically used in applications that provide menu items for selecting the various clipboard commands (e.g., Copy). If GetSelection returns False, these commands should be disabled.

See also: SetSelection


TOvcBaseViewer.GotoMarker
GotoMarker method

procedure TOvcBaseViewer.GotoMarker(N : Byte);

GotoMarker moves the caret to the specified bookmark.

This method moves the caret to the N'th bookmark, where N is a value in the range 0..9. If there is no N'th bookmark, GotoMarker does nothing.

See also: SetMarker, SetMarkerAt


TOvcBaseViewer.HighlightColors
HighlightColors property

property TOvcBaseViewer.HighlightColors : TOvcColors

Default: clHighlightText and clWindow

HighlightColors are the colors used to display the selected portion of the viewer's text stream.

The following example shows how to change the viewer's colors at run time so that highlighted text is displayed with blue text on a white background.

HighlightColors.TextColor := clBlue;

HighlightColors.BackColor := clWhite;


TOvcBaseViewer.LineCount
LineCount run-time property

property TOvcBaseViewer.LineCount : LongInt

LineCount determines the number of lines in the viewer.

In descendent components, this property must be set to tell the viewer how many lines of text there are to be viewed. TOvcFileViewer and TOvcTextFileViewer do this for you.


TOvcBaseViewer.LineLength
LineLength run-time read-only property

property TOvcBaseViewer.LineLength[LineNum : LongInt] : Integer

LineLength returns the length of the specified line.

This indexed property returns the length (tabs are not expanded) of the line specified by LineNum. The Valid range for LineNum is 0 to LineCount-1. If LineNum is invalid, -1 is returned.

See also: LineCount


TOvcBaseViewer.Lines
Lines run-time read-only property

property TOvcBaseViewer.Lines[LineNum : LongInt] : string

Lines returns the text of the specified line.

This indexed property returns the text of the line specified by LineNum in a format suitable for printing (i.e., with tabs expanded to spaces). If the length of the specified line is greater than 255, it is truncated to 255 characters. If the viewer contains lines longer than 255, use the GetPrintableLine method instead.

The Valid range for LineNum is 0 to LineCount-1. If LineNum is invalid, an empty string is returned.

See also: GetLine, GetPrintableLine, LineCount


TOvcBaseViewer.MarginColor
MarginColor property

property TOvcBaseViewer.MarginColor : TColor

Default: clWindow

MarginColor determines the color of the margin area at the left of the viewer.

This property determines the color used to paint the blank area to the left of the first character of each line in the viewer window.


TOvcBaseViewer.OnShowStatus
OnShowStatus event

property TOvcBaseViewer.OnShowStatus : TShowStatusEvent

TShowStatusEvent = procedure(Sender : TObject; LineNum : LongInt; ColNum : Integer) of object;

OnShowStatus defines an event handler that is called when the caret position changes.

Sender is the object that generated the event. ColNum is the new effective caret column position. LineNum is the new line number. See the TEXTVIEW or FILEVIEW example programs for examples of status routines that use an OnShowStatus event handler.


TOvcBaseViewer.OnUserCommand
OnUserCommand event

property TOvcBaseViewer.OnUserCommand : TUserCommandEvent

TUserCommandEvent = procedure(Sender : TObject; Command : Word) of object;

OnUserCommand defines an event handler that is called when a user-defined command is entered.

The method assigned to the OnUserCommand event is called when the key sequence corresponding to one of the user-defined commands (ccUser1, ccUser2, etc.) is entered.

For example, suppose you add the <CtrlF2> key sequence to the one of the active command tables and assign it to the ccUser1 command. When <CtrlF2> is pressed, the method assigned to the OnUserCommand event is called and ccUser1 is passed in Command. Sender is the object that intercepted the key sequence.

See the TOvcCommandProcessor Class for additional information about user-defined commands and command tables.


TOvcBaseViewer.ScrollBars
ScrollBars property

property TOvcBaseViewer.ScrollBars : TScrollStyle

Default: ssBoth

ScrollBars determines whether vertical and horizontal scroll bars are displayed.

The TScrollStyle enumerated type is defined in the Delphi Controls unit. Both vertical and horizontal scroll bars are displayed by default.


TOvcBaseViewer.Search
Search virtual method

function TOvcBaseViewer.Search(const S : string; Options : TSearchOptionSet) : Boolean; virtual;

TSearchOptionSet = set of TSearchOptions;

TSearchOptions = (soFind, soBackward, soMatchCase, soGlobal, soReplace, soReplaceAll, soWholeWord, soSelText);

Search searches for a string.

If the search string S is found, Search selects the matched string and positions the caret to the right of the selected text, returning True as the function result.

The following can be specified in Options:

soFind - A single find operation is requested.

soBackward - Search backward.

soMatchCase - Perform a case-sensitive search.

soGlobal - The search should start at the beginning or end of the file, depending on the state of the soBackward option, instead of at the current caret position.

The Options parameter must have the soFind option set. It can also have any of the other options set.

See the TEXTVIEW or FILEVIEW example programs for examples of implementing Search.


TOvcBaseViewer.SelectAll
SelectAll method

procedure TOvcBaseViewer.SelectAll(CaretAtEnd : Boolean);

SelectAll selects all text in the viewer.

After the call to SelectAll, all of the viewer's text is selected. The caret is positioned at the end of the selection if CaretAtEnd is True, or at (0, 0) if it is False.

The following example selects all text in the viewer and places the caret at (0,0).

SelectAll(False);

See also: GetSelection, SetSelection


TOvcBaseViewer.SetCaretPosition
SetCaretPosition method

procedure TOvcBaseViewer.SetCaretPosition(Line : LongInt; Col : Integer);

SetCaretPosition moves the caret to the specified line and column.

Col is an actual column number, not an effective column number.

The following example moves the caret to column 1 of the last line.

SetCaretPosition(LineCount-1, 0);

See also: GetCaretPosition


TOvcBaseViewer.SetMarker
SetMarker method

procedure TOvcBaseViewer.SetMarker(N : Byte);

SetMarker sets a bookmark at the current caret position.

This method sets bookmark N to point to the current position of the caret.

The following example demonstrates setting bookmark 1 to point to the current position of the caret.

SetMarker(1);

See also: ClearMarker, GetMarkerPosition, GotoMarker, SetMarkerAt, ShowBookmarks


TOvcBaseViewer.SetMarkerAt
SetMarkerAt method

procedure TOvcBaseViewer.SetMarkerAt(N : Byte; Line : LongInt; Col : Integer);

SetMarkerAt sets a bookmark at the specified position.

This method sets bookmark N to point to the specified line and column. Col is assumed to be an actual column number, not an effective column number.

The following example demonstrates setting bookmark 1 to point to the first character of the last line in the editor.

SetMarkerAt(1, LineCount-1, 0);

See also: ClearMarker, GetMarkerPosition, GotoMarker, SetMarker, ShowBookmarks


TOvcBaseViewer.SetSelection
SetSelection method

procedure TOvcBaseViewer.SetSelection(Line1 : LongInt; Col1 : Integer; Line2 : LongInt; Col2 : Integer ; CaretAtEnd : Boolean);

SetSelection selects a region of text.

After the call to SetSelection, the region from (Line1,Col1) to (Line2,Col2) is selected. The caret is positioned at (Line2,Col2) if CaretAtEnd is True, or at (Line1,Col1) if it is False. Col1 and Col2 are actual column numbers.

The following example selects all text in the viewer and places the caret at (0,0).

SetSelection(0, 0, LineCount-1, LineLength(LineCount)-1, False);

See also: GetSelection, LineLength


TOvcBaseViewer.ShowBookmarks
ShowBookmarks property

property TOvcBaseViewer.ShowBookmarks : Boolean

Default: True

ShowBookmarks determines if the bookmark icons are displayed.

If ShowBookmarks is True, the bookmark icons are displayed. All "marker" functions operate regardless of the ShowBookmarks setting.

See also: ClearMarker, GotoMarker, SetMarker, SetMarkerAt


TOvcBaseViewer.TabSize
TabSize property

property TOvcBaseViewer.TabSize : Byte

Default: 8

TabSize is the number of spaces substituted for tab characters.

This property determines the number of spaces used to replace tab characters within the viewer's text if the ExpandTabs property is True.

See also: ExpandTabs


TOvcBaseViewer.TopLine
TopLine run-time property

property TOvcBaseViewer.TopLine : LongInt

TopLine determines the line at the top of the viewer window.

Assigning a value between 0 and LineCount-1 to this property causes the viewer to redraw itself with that line at the top of the window.

See also: LineCount


TOvcBaseViewer.events
TOvcBaseViewer events

OnClick 	OnKeyPress

OnDblClick 	OnKeyUp

OnDragDrop 	OnMouseDown

OnDragOver 	OnMouseMove

OnEndDrag 	OnMouseUp

OnEnter 	OnShowStatus

OnExit 	OnUserCommand

OnKeyDown


TOvcBaseViewer.methods
TOvcBaseViewer methods

ActualColumn	HandleAllocated

AlignControls 	HandleNeeded

Assign	HasParent

AssignTo 	Hide

BeginDrag	InheritsFrom

BringToFront	InitInstance

Broadcast	InsertComponent

CanFocus	InsertControl

ChangeName 	InstanceSize

ChangeScale 	Invalidate

ClassInfo	IsControlMouseMsg

ClassName	KeyDown

ClassParent	KeyPress

ClassType	KeyUp

ClearMarker	Loaded

Click 	MainWndProc

ClientToScreen	MethodAddress

ContainsControl	MethodName

ControlAtPos	MouseDown

CopyToClipboard	MouseMove

Create	MouseUp

CreateHandle 	NewInstance

CreateSubClass 	NotifyControls

CreateWindowHandle 	PaintControls

DblClick 	PaintHandler

DefaultHandler 	PaintWindow

DefineProperties 	PaletteChanged

Destroy	Perform

DestroyComponents	ReadState

DestroyHandle 	Realign

Destroying	RecreateWnd

DestroyWindowHandle 	Refresh

DestroyWnd 	RemoveComponent

DisableAlign	RemoveControl

Dispatch	Repaint

DoEnter 	ScaleBy

DoExit 	ScaleControls

DoKeyDown 	ScreenToClient

DoKeyPress 	ScrollBy

DoKeyUp 	Search

DragCanceled 	SelectAll

Dragging	SelectFirst

EffectiveColumn	SelectNext

EnableAlign	SendToBack

EndDrag	SetCaretPosition

FieldAddress	SetDesigning

FindComponent	SetFocus

FindNextControl 	SetMarker

Focused	SetMarkerAt

Free	SetName

FreeInstance	SetParent

GetCaretPosition	SetSelection

GetClientOrigin 	SetTextBuf

GetClientRect 	SetZOrder

GetDeviceContext 	Show

GetLine	ShowControl

GetMarkerPosition	Update

GetPalette 	UpdateBoundsRect

GetPrintableLine	ValidateRename

GetSelection	VisibleChanging

GetTabOrderList	WndProc

GetTextBuf	WriteComponents

GetTextLen	WriteState

GotoMarker


TOvcBaseViewer.properties
TOvcBaseViewer properties

Align 	Height

BorderStyle  	HelpContext

BoundsRect 	HighlightColors

Brush 	Hint

Canvas  	IsControl

Caption  	Left

Caret  	LineCount

CaretActualPos 	LineLength

CaretEffectivePos 	Lines

ClientHeight 	MarginColor

ClientOrigin 	MouseCapture

ClientRect 	Name

ClientWidth 	Owner

Color  	Parent

ComponentCount 	ParentColor

ComponentIndex 	ParentCtl3D

Components 	ParentFont

ComponentState 	ParentShowHint

ControlCount 	PopupMenu

Controller  	ScrollBars

Controls 	ShowBookmarks

ControlState 	ShowHint

ControlStyle 	Showing

Ctl3D  	TabOrder

Cursor	TabSize

DefWndProc  	TabStop

DesignInfo 	Tag

DragCursor  	Text

DragMode  	Top

Enabled 	TopLine

ExpandTabs  	Visible

FixedFont  	Width

Font  	WindowHandle

Handle


TOvcCalendar
 TOvcCalendar component

See also: properties, events, methods, hierarchy

Component Overview

The TOvcCalendar component provides a grid-like display of a month with each row of the grid representing one week and each column representing a day. You can specify which day is at the left of the calendar grid and the colors for the active day, current month, day names (at the top of the grid), and the days of the previous and next months.

Navigation through the years, months, and days is accomplished through the calendar's connection to the Controller's command processor.


TOvcCalendar hierarchy


TOvcCalendar.BorderStyle
BorderStyle property

property TOvcCalendar.BorderStyle : TBorderStyle

Default: bsSingle

BorderStyle determines the style used when drawing the border.

The possible values are bsSingle (a single line border is drawn around the component) or bsNone (no border line).

The TBorderStyle type is defined in the Delphi Controls unit.


TOvcCalendar.CalendarDate
CalendarDate run-time property

property TOvcCalendar.CalendarDate : TOvcDate

CalendarDate determines the day, month, and year displayed by the calendar.

This property determines the date that the calendar displays. Assigning a value to CalendarDate causes the calendar to display that date as its active date.

See also: Day, Month, Year


TOvcCalendar.Colors
Colors property

property TOvcCalendar.Colors : TOvcCalendarColors

Default: (clHighlightText, clHighlight) for ActiveColor;

(clWindowText, clWindow) for InactiveColor;

(clWindowText, clWindow) for LabelColor;

(clWindowText, clWindow) for TextColor

Colors determines the colors used for the calendar.

This property is composed of four TOvcColors properties. See the TOvcColors Class  for additional information.

ActiveColor is the color set for the highlighted date. InactiveColor is the color set for days from the previous or next month. LabelColor is the color set for the names of the days of the week at the top of the calendar grid. TextColor is the color set for the unhighlighted days in the current month.


TOvcCalendar.DateString
DateString method

function TOvcCalendar.DateString(const Mask : string): string;

DateString returns a string version of the current date.

DateString calls TOvcIntlSup.DateToDateString, passing Mask and the highlighted date as the parameters.


TOvcCalendar.Day
Day property

property TOvcCalendar.Day : Integer

Default: the current day of the month

Day determines the day of the month.

Assigning a valid value to this property changes the calendar's active day.

See also: CalendarDate, Month, Year


TOvcCalendar.DayNameLen
DayNameLen property

property TOvcCalendar.DayNameLen : Byte

Default: 3

DayNameLen determines the length of the day name.

This property controls the number of characters used to display the day of the week at the top of the calendar.


TOvcCalendar.DayString
DayString method

function TOvcCalendar.DayString : string;

DayString returns the name of the active day.

This function returns a string containing the name of the calendar's active day. It does this by retrieving the day name from the LongDayNames array, defined in the Delphi SysUtils unit.

See also: MonthString


TOvcCalendar.IntlSupport
IntlSupport run-time property

property TOvcCalendar.IntlSupport : TOvcIntlSup

Default: OvcIntlSup

IntlSupport provides access to the international support object that is attached to the calendar component.

A global international support object is created during initialization of the OvcIntl unit and all calendar components use it by default. You can create an additional TOvcIntlSup object, tailor the international settings, and attach it to the calendar component by assigning it to this property.


TOvcCalendar.Month
Month property

property TOvcCalendar.Month : Integer

Default: the current month

Month determines the month displayed by the calendar.

Assigning a valid value to this property changes the calendar's active month.

See also: CalendarDate, Day, Year


TOvcCalendar.MonthString
MonthString method

function TOvcCalendar.MonthString : string;

MonthString returns the name of the active month.

This function returns a string containing the name of the calendar's active month. It does this by retrieving the month name from the LongMonthNames array, defined in the Delphi SysUtils unit.

See also: DayString


TOvcCalendar.OnChange
OnChange event

property TOvcCalendar.OnChange : TNotifyEvent

OnChange defines an event handler that is called when the calendar is changed.

The method assigned to the OnChange event is called when the calendar's active day, month, or year changes.


TOvcCalendar.OnDrawItem
OnDrawItem event

property TOvcCalendar.OnDrawItem : TDrawItemEvent

TDrawItemEvent = procedure(Sender : TObject; Day, Month, Year : Integer; const Rect : TRect) of object;

OnDrawItem defines an event handler that is called when a calendar cell is drawn.

The method assigned to the OnDrawItem event is called to paint the cell defined by Rect, for the date represented by Day, Month, and Year. If no method is assigned, the day number is drawn at the center of the calendar cell.


TOvcCalendar.OnUserCommand
OnUserCommand event

property TOvcCalendar.OnUserCommand : TUserCommandEvent

TUserCommandEvent = procedure(Sender : TObject; Command : Word) of object;

OnUserCommand defines an event handler that is called when a user-defined command is entered.

The method assigned to the OnUserCommand event is called when you enter the key sequence corresponding to one of the user-defined commands (ccUser1, ccUser2, etc.).

For example, suppose you add the <CtrlD> key sequence to one of the active command tables and assign it to the ccUser1 command. When you press <CtrlD>, the method assigned to the OnUserCommand event is called and ccUser1 is passed in Command.

See the TOvcCommandProcessor Class for additional information about user-defined commands and command tables.


TOvcCalendar.SetToday
SetToday method

procedure TOvcCalendar.SetToday;

SetToday changes the calendar's active date to today's date.

See also: CalendarDate


TOvcCalendar.WeekStarts
WeekStarts property

property TOvcCalendar.WeekStarts : TDayType

Default: Sunday

WeekStarts determines the day of the week that begins a week.

This property determines which day of the week is drawn in the left column of the calendar.


TOvcCalendar.Year
Year property

property TOvcCalendar.Year : Integer

Default: the current year

Year determines the year displayed by the calendar.

Assigning a valid value to this property changes the calendar's active year.

See also: CalendarDate, Day, Month


TOvcCalendar.events
TOvcCalendar events

OnChange	OnExit

OnClick	OnKeyDown

OnDblClick	OnKeyPress

OnDragDrop	OnKeyUp

OnDragOver	OnMouseDown

OnDrawItem	OnMouseMove

OnEndDrag	OnMouseUp

OnEnter	OnUserCommand


TOvcCalendar.methods
TOvcCalendar methods

AlignControls 	HasParent

Assign	Hide

AssignTo 	InheritsFrom

BeginDrag	InitInstance

BringToFront	InsertComponent

Broadcast	InsertControl

CanFocus	InstanceSize

ChangeName 	Invalidate

ChangeScale 	IsControlMouseMsg

ClassInfo	KeyDown

ClassName	KeyPress

ClassParent	KeyUp

ClassType	Loaded

Click 	MainWndProc

ClientToScreen	MethodAddress

ContainsControl	MethodName

ControlAtPos	MonthString

Create	MouseDown

CreateHandle 	MouseMove

CreateSubClass 	MouseUp

CreateWindowHandle 	NewInstance

DateString	NotifyControls

DayString	PaintControls

DblClick 	PaintHandler

DefaultHandler 	PaintWindow

DefineProperties 	PaletteChanged

Destroy	Perform

DestroyComponents	ReadState

DestroyHandle 	Realign

Destroying	RecreateWnd

DestroyWindowHandle 	Refresh

DestroyWnd 	RemoveComponent

DisableAlign	RemoveControl

Dispatch	Repaint

DoEnter 	ScaleBy

DoExit 	ScaleControls

DoKeyDown 	ScreenToClient

DoKeyPress 	ScrollBy

DoKeyUp 	SelectFirst

DragCanceled 	SelectNext

Dragging	SendToBack

EnableAlign	SetBounds

EndDrag	SetDesigning

FieldAddress	SetFocus

FindComponent	SetName

FindNextControl 	SetParent

Focused	SetTextBuf

Free	SetToday

FreeInstance	SetZOrder

GetClientOrigin 	Show

GetClientRect 	ShowControl

GetDeviceContext 	Update

GetPalette 	UpdateBoundsRect

GetTabOrderList	ValidateRename

GetTextBuf	VisibleChanging

GetTextLen	WndProc

HandleAllocated	WriteComponents

HandleNeeded	WriteState


TOvcCalendar.properties
TOvcCalendar properties

Align	Font

BorderStyle	Handle

BoundsRect 	Height

Brush 	HelpContext

CalendarDate 	Hint

Canvas 	IntlSupport

Caption  	IsControl

ClientHeight 	Left

ClientOrigin 	Month

ClientRect 	MouseCapture

ClientWidth 	Name

Color  	Owner

Colors	Parent

ComponentCount 	ParentColor

ComponentIndex 	ParentCtl3D

Components 	ParentFont

ComponentState 	ParentShowHint

ControlCount 	PopupMenu

Controller	ShowHint

Controls 	Showing

ControlState 	TabOrder

ControlStyle 	TabStop

Ctl3D	Tag

Cursor	Text

Day	Top

DayNameLen	Visible

DefWndProc  	WeekStarts

DesignInfo 	Width

DragCursor	WindowHandle

DragMode	Year

Enabled


TOvcCaret
TOvcCaret class

See also: properties, methods, hierarchy

Class Overview

The TOvcCaret class provides a wrapper around the most frequently used Windows caret handling routines. This class provides configuration options for the editing carets used by the Orpheus entry field, editor, and viewer components. It provides properties that allow you to customize the shape, placement, blink rate, and size of the editing caret.


TOvcCaret hierarchy


TOvcCaret.Align
Align property

property TOvcCaret.Align : TOvcCaretAlign

TOvcCaretAlign = (caLeft, caTop, caRight, caBottom, caCenter);

Default: caLeft

Align determines the placement of the caret.

This property determines the placement of the caret shape within a character cell. A character cell is defined by the average width and height of the font being used. Possible align values are:

caLeft - The caret is at the left edge of the character cell and centered vertically.

caTop - The caret is at the top of the character cell and centered horizontally.

caRight - The caret is at the right edge of the character cell and centered vertically.

caBottom - The caret is at the bottom of the character cell and centered horizontally.

caCenter - The caret is centered horizontally and vertically within the character cell.


TOvcCaret.Bitmap
Bitmap property

property TOvcCaret.Bitmap : TBitmap

Bitmap defines the bitmap resource that is used for the caret shape.

If the Shape property is set to csBitmap, the bitmap assigned to Bitmap is used as the caret shape. When the bitmap is displayed, it is XOR'ed with the colors beneath it, so take that into account when you choose the colors for the bitmap.

See also: Shape


TOvcCaret.BitmapHotSpotX
BitmapHotSpotX property

property TOvcCaret.BitmapHotSpotX : Integer

Default: 0

BitmapHotSpotX is the X offset (in pixels) for a bitmap caret.

If Shape is set to csBitmap, this property is used when positioning the bitmap within the character cell. For any other value of Shape, BitmapHotSpotX is ignored.

The value of this property is best determined by experimentation.

See also: Bitmap, BitmapHotSpotY, Shape


TOvcCaret.BitmapHotSpotY
BitmapHotSpotY property

property TOvcCaret.BitmapHotSpotY : Integer

Default: 0

BitmapHotSpotY is the Y offset (in pixels) for a bitmap caret.

If Shape is set to csBitmap, this property is used when positioning the bitmap within the character cell. For any other value of Shape, BitmapHotSpotY is ignored.

The value of this property is best determined by experimentation.

See also: Bitmap, BitmapHotSpotX, Shape


TOvcCaret.BlinkTime
BlinkTime property

property TOvcCaret.BlinkTime : word

Default: current Windows setting

BlinkTime determines the rate at which the caret blinks.

The caret flashes on or off every BlinkTime milliseconds. One complete flash (off and on) takes BlinkTime*2 milliseconds. If you set this property to 0, the blink rate is set to the current Windows default.


TOvcCaret.CaretHeight
CaretHeight property

property TOvcCaret.CaretHeight : Integer

Default: 10

CaretHeight is the height of the caret in pixels.

If the Shape property is set to csCustom, CaretHeight determines the height of the caret. If Shape is csBitmap, the height of the caret is determined by the actual height of the bitmap.

See also: CaretWidth, Shape


TOvcCaret.CaretWidth
CaretWidth property

property TOvcCaret.CaretWidth : Integer

Default: 2

CaretWidth is the width of the caret.

If the Shape property is set to csCustom, CaretWidth determines the width of the caret. If Shape is csBitmap, the width of the caret is determined by the actual width of the bitmap.

See also: CaretHeight, Shape


TOvcCaret.IsGray
IsGray property

property TOvcCaret.IsGray : Boolean

Default: False

IsGray determines whether the caret is "grayed out."


TOvcCaret.Shape
Shape property

property TOvcCaret.Shape : TOvcCaretShape

TOvcCaretShape = (csBlock, csHalfBlock, csVertLine, csHorzLine, csCustom, csBitmap);

Default: csVertLine

Shape determines the shape of the caret.

The possible shape values are:

csBlock - A block caret that covers the whole character cell.

csHalfBlock - A block caret that covers the bottom half of the character cell.

csVertLine - A vertical line caret positioned at the left (by default) of the character cell. Use Align to change the position of the caret.

csHorzLine - A horizontal line caret positioned on the bottom (by default) of the character cell. Use Align to change the position of the caret.

csCustom - CaretWidth and CaretHeight determine the shape of the caret.

csBitmap - The caret defined by Bitmap.

See also: Align, Bitmap, CaretHeight, CaretWidth


TOvcCaret.methods
TOvcCaret methods

Assign	Dispatch

AssignTo 	FieldAddress

ClassInfo	Free

ClassName	FreeInstance

ClassParent	InheritsFrom

ClassType	InitInstance

Create	InstanceSize

DefaultHandler	MethodAddress

DefineProperties 	MethodName

Destroy	NewInstance


TOvcCaret.properties
TOvcCaret properties

Align	CaretHeight

Bitmap	CaretWidth

BitmapHotSpotX	IsGray

BitmapHotSpotY	Shape

BlinkTime


TOvcCellGlyphs
TOvcCellGlyphs class

See also: properties, methods, hierarchy

Class Overview

The TOvcCellGlyphs class provides bitmap resource management and encapsulation for the glyph table cell components (TOvcTCGlyph and TOvcTCCheckBox).

The class conserves resources by reusing a set of glyphs between many cell components. The glyphs are equal-sized square subdivisions of a single bitmap. Each subdivision is a single glyph, and the cell cycles through the glyphs on user demand. The layout of the bitmap must be a set of glyphs placed side by side in a line, all of equal width and equal height. This is the same layout as the glyphs in the bitmaps for Delphi's TSpeedButton objects.

TOvcCellGlyphs has a default state that uses the three normal checkbox glyphs (unchecked, checked, and grayed). This bitmap is part of the resource file for the table and is linked automatically into your application.

The glyphs are painted with the BrushCopy method of the Delphi TCanvas class, so you can specify a "transparent" color as the bottom left pixel of each glyph. When the glyph is painted, all pixels of this color in the glyph are changed to the background color of the canvas on which the glyph is drawn. See the Delphi documentation for more details.


TOvcCellGlyphs hierarchy


TOvcCellGlyphs.ActiveGlyphCount
ActiveGlyphCount property

property TOvcCellGlyphs.ActiveGlyphCount : Integer

ActiveGlyphCount is the number of glyphs in the bitmap that are cycled through at run-time.

ActiveGlyphCount allows you to display a subset of the total number of glyphs when the glyph cell is edited at run time. For example, a checkbox has a total of three glyphs that can be displayed (unchecked, checked and grayed). If you do not want the grayed checkbox to be displayed, set ActiveGlyphCount to 2.

ActiveGlyphCount is forced to be greater than zero, and less than or equal to GlyphCount.

See also: BitMap, GlyphCount


TOvcCellGlyphs.BitMap
BitMap property

property TOvcCellGlyphs.BitMap : TBitMap

Default: the set of checkbox glyphs

BitMap is the collection of glyphs as a single bitmap.

When you assign a new bitmap to BitMap, the object resets the GlyphCount and ActiveGlyphCount properties. It does this by assuming that all the glyphs are square and the same size and by doing a simple calculation. The IsDefault property is automatically changed to False.

If you set BitMap to nil, IsDefault is set to True and the default bitmap resource is reallocated to the object.

See also: ActiveGlyphCount, GlyphCount, IsDefault


TOvcCellGlyphs.GlyphCount
GlyphCount property

property TOvcCellGlyphs.GlyphCount : Integer

GlyphCount is the total number of glyphs in the bitmap.

GlyphCount specifies the total number of glyphs that could be displayed when the glyph cell is edited at run time. The actual number that will be displayed depends on ActiveGlyphCount.

Setting GlyphCount to zero or less has no effect.

See also: ActiveGlyphCount, BitMap


TOvcCellGlyphs.IsDefault
IsDefault property

property TOvcCellGlyphs.IsDefault : Boolean

Default: True

IsDefault indicates whether the object is in its default state.

When the object is in its default state, it refers to the checkbox glyphs. If you set IsDefault to True, the current bitmap resource is freed.

See also: BitMap


TOvcCellGlyphs.methods
TOvcCellGlyphs methods

Assign	Dispatch

AssignTo 	FieldAddress

ClassInfo	Free

ClassName	FreeInstance

ClassParent	InheritsFrom

ClassType	InitInstance

Create	InstanceSize

DefaultHandler	MethodAddress

DefineProperties 	MethodName

Destroy	NewInstance


TOvcCellGlyphs.properties
TOvcCellGlyphs properties

ActiveGlyphCount	GlyphCount

BitMap	IsDefault


TOvcColors
TOvcColors class

See also: properties, methods, hierarchy

Class Overview

The TOvcColors class is used by many Orpheus components to combine text and background colors in one property. In addition to visually grouping the colors in the Object Inspector, TOvcColors also provides the ability to revert to default text and background colors.

Setting the UseDefault property to True restores the default text and background colors. The default colors are set by passing them as parameters to the Create constructor when an instance of the TOvcColors class is created.

constructor Create(FG, BG : TColor); virtual;

FG and BG are the default text and background colors for this instance of TOvcColors.


TOvcColors hierarchy


TOvcColors.BackColor
BackColor property

property TOvcColors.BackColor : TColor

BackColor is the background color.

See also: TextColor


TOvcColors.TextColor
TextColor property

property TOvcColors.TextColor : TColor

TextColor is the text color.

See also: BackColor


TOvcColors.UseDefault
UseDefault property

property TOvcColors.UseDefault : Boolean

Default: True

UseDefault determines whether the default colors are used.

If you set UseDefault to True, the default color values are assigned to the TextColor and BackColor properties. If you set the TextColor or BackColor properties, UseDefault is set to False.

See also: BackColor, TextColor


TOvcColors.methods
TOvcColors methods

Assign	Dispatch

AssignTo 	FieldAddress

ClassInfo	Free

ClassName	FreeInstance

ClassParent	InheritsFrom

ClassType	InitInstance

Create	InstanceSize

DefaultHandler	MethodAddress

DefineProperties 	MethodName

Destroy	NewInstance


TOvcColors.properties
TOvcColors properties

BackColor	UseDefault

TextColor


TOvcCommandProcessor
TOvcCommandProcessor class

See also: properties, methods, hierarchy

Class Overview

TOvcCommandProcessor translates Windows messages to commands for the Orpheus components. Message structures are passed to the command processor's Translate method which then searches its active command tables for an entry that matches the key sequences stored in the message structure. If one is found, the corresponding command is returned to the calling component.

An instance of the TOvcCommandProcessor is created and owned by each TOvcController component. Other Orpheus components have access to the command processor through their Controller property.


TOvcCommandProcessor hierarchy


TOvcCommandProcessor.Add
Add method

procedure TOvcCommandProcessor.Add(CT : TOvcCommandTable);

Add a command table to the list of tables.

This method adds the TOvcCommandTable object specified by CT to the list of command tables maintained by the command processor. Multiple command tables can be created to increase functionality or to allow use of different commands.

See also: AddCommand, CreateCommandTable


TOvcCommandProcessor.AddCommand
AddCommand method

procedure TOvcCommandProcessor.AddCommand(const TableName : string; Key1, ShiftState1, Key2, ShiftState2 : Byte; Command : Word);

Add a command and key sequence to the command table.

TableName is the name of one of the command tables currently maintained by the command processor object. The table name is not case sensitive. Key1 and optionally Key2 contain the key codes. ShiftState1 and ShiftState2 contain the shift-state constants if shift keys must be pressed. Command is the command to associate with the key sequence. If there is no second key, set Key2 and ShiftState2 both to zero.

If the specified TableName does not exist, an ETableNotFound exception is raised. If the key sequence specified in Key1, ShiftState1, Key2, and ShiftState2 is already assigned within TableName, an EDuplicateCommand exception is raised.

See the Delphi Messages unit or the on-line help system for information about the constants used to identify keys. Some virtual key codes used in the tables are not defined by Delphi. They are defined in OVCCONST.PAS (VK_A, the 'a' key, is a simple example of one of these constants).

The possible values for ShiftState1 and ShiftState2 are:

ss_None       $00	no shift key

ss_Shift      $02	<Shift>

ss_Ctrl       $04	<Ctrl>

ss_Alt        $08	<Alt>

ss_Wordstar   $80	the second key of a WordStar command, which is accepted if no shift key is pressed or if the <Ctrl> key is pressed

The following example adds a key mapping for the <ShiftAltF5> key sequence to the DEFAULT command table. When the command processor sees this key sequence, it will return the ccUser5 command.

const

  ccUser5 = ccUserFirst + 5;

...

AddCommand('DEFAULT', VK_F5, ss_Shift +  ss_Alt, 0, 0, ccUser5);

The following example adds a WordStar-style key sequence to the WORDSTAR command table. After executing this command, pressing <CtrlQ><S> or <CtrlQ><CtrlS> returns the ccHome command.

AddCommand('WORDSTAR', VK_Q, ss_Ctrl, VK_S, ss_Wordstar, ccHome);

See also: AddCommandRec, DeleteCommand


TOvcCommandProcessor.AddCommandRec
AddCommandRec method

procedure TOvcCommandProcessor.AddCommandRec(const TableName : string; const CR : TOvcCmdRec);

Add a command record to the command table.

This procedure is identical to the AddCommand procedure except that the key and command information is passed as a TOvcCmdRec instead of in individual parameters.

If the specified TableName does not exist, an ETableNotFound exception is raised. If the key sequence specified in CR is already assigned within TableName, an EDuplicateCommand exception is raised.

See also: AddCommand


TOvcCommandProcessor.ChangeTableName
ChangeTableName method

procedure TOvcCommandProcessor.ChangeTableName(const OldName, NewName : string);

ChangeTableName changes the name of a command table.

The name of the command table is changed from OldName to NewName. If the specified OldName does not exist, an ETableNotFound exception is raised.

The following example renames the DEFAULT table to MYTABLE.

ChangeTableName('DEFAULT', 'MYTABLE');


TOvcCommandProcessor.Clear
Clear method

procedure TOvcCommandProcessor.Clear;

Clear removes all tables from the internal command table list.

This procedure removes all command tables from the internal command table list, in contrast to Delete or DeleteCommandTable, both of which remove only one table at a time.

See also: Delete, DeleteCommandTable


TOvcCommandProcessor.Count
Count run-time read-only property

property TOvcCommandProcessor.Count : Integer

Count is the number of command tables.

This property provides the current number of command tables maintained by the command processor.


TOvcCommandProcessor.CreateCommandTable
CreateCommandTable method

function TOvcCommandProcessor.CreateCommandTable(const TableName : string; Active : Boolean) : Integer;

CreateCommandTable creates a command table and adds it to the list of tables.

This method creates a new command table with the name TableName. The table is marked as active if Active is True. The new command table is initially empty.

The function result is the index into the internal list of command tables. If the table could not be created or TableName already exists, the function result is -1.

The following example creates a new command table named SAMPLE, which is initially active.

CreateCommandTable('SAMPLE', True);

See also: AddCommand, AddCommandRec, Delete, DeleteCommandTable


TOvcCommandProcessor.Delete
Delete method

procedure TOvcCommandProcessor.Delete(Index : Integer);

Delete a command table from the list of tables.

The Delete procedure deletes an existing table from the internal command table list. Index is the location of the command table in the list. If the specified table does not exist, an ETableNotFound exception is raised.

The following example removes the first command table if there are at least two existing command tables.

if Count > 1 then

  Delete(0);

See also: CreateCommandTable, DeleteCommandTable


TOvcCommandProcessor.DeleteCommand
DeleteCommand method

procedure TOvcCommandProcessor.DeleteCommand(const TableName : string; Key1, ShiftState1, Key2, ShiftState2 : Byte);

DeleteCommand deletes a command and key sequence from a command table.

This procedure removes a single entry from the command table specified by TableName. If an entry is found that matches the Key1, ShiftState1, Key2, and ShiftState2 parameters exactly, it is removed from the command table. See AddCommand for a description of these parameters. If the specified TableName does not exist, an ETableNotFound exception is raised.

The following example deletes the command table entry corresponding to the <ShiftAltF5> key sequence from the DEFAULT command table.

DeleteCommand('DEFAULT', VK_F5, ss_Shift + ss_Alt, 0, 0);

See also: AddCommand


TOvcCommandProcessor.DeleteCommandTable
DeleteCommandTable method

procedure TOvcCommandProcessor.DeleteCommandTable(const TableName : string);

Delete a command table from the list of tables.

This procedure deletes the table specified by TableName from the internal list of command tables. If the specified TableName does not exist, an ETableNotFound exception is raised.

The following example deletes the SAMPLE command table from the command processor's command table list.

DeleteCommandTable('SAMPLE');


TOvcCommandProcessor.Exchange
Exchange method

procedure TOvcCommandProcessor.Exchange(Index1, Index2 : Integer);

Exchange swaps the locations of two command tables.

This method swaps the locations of the command tables specified by Index1 and Index2. This is normally done so that one table is scanned prior to the other.

The following example swaps the location of the tables at the index 2 and index 5 positions.

Exchange(2, 5);

See also: Add, Delete, DeleteCommandTable


TOvcCommandProcessor.GetCommandCount
GetCommandCount method

function TOvcCommandProcessor.GetCommandCount(const TableName : string) : Integer;

GetCommandCount returns the number of commands in the command table.

This method gets the number of commands in the command table specified by TableName. If the table does not exist, the function returns zero. If the specified TableName does not exist, an ETableNotFound exception is raised.

The following example tests to see if the DEFAULT command table has at least one entry before doing something.

if GetCommandCount('DEFAULT') > 0 then begin

  {do something}

end;


TOvcCommandProcessor.GetCommandTable
GetCommandTable method

function TOvcCommandProcessor.GetCommandTable(const TableName : string) : TOvcCommandTable;

GetCommandTable returns a pointer to a command table.

This method gets a pointer to the command table specified by TableName. If the table does not exist, nil is returned as the function result.

The following example gets a pointer to the DEFAULT command table.

var

  CT : TOvcCommandTable;

...

CT := GetCommandTable('DEFAULT');

if CT <> nil then begin

  {do something with the command table, CT}

end;


TOvcCommandProcessor.GetCommandTableIndex
GetCommandTableIndex method

function TOvcCommandProcessor.GetCommandTableIndex(const TableName : string) : Integer;

GetCommandTableIndex returns the index of a command table.

This method searches the command processor's internal list of command tables for TableName and returns its index. If the table does not exist, -1 is returned.


TOvcCommandProcessor.LoadCommandTable
LoadCommandTable virtual method

function TOvcCommandProcessor.LoadCommandTable(const FileName : string) : Integer; virtual;

LoadCommandTable creates a command table and fills it from a text file.

This function creates a new command table and then fills it using the contents of the text file FileName. If LoadCommandTable is successful, the function result is the index into the internal command table list. If it is not successful, the function result is -1.

The text file specified by FileName must have the following format:

TableName

Key1 Shift1 Key2 Shift2 ccCommand

Key1 Shift1 Key2 Shift2 ccCommand

...

TableName is a string representing the name of the table and is assigned as the name of the table when the command table is loaded. Key1 and Key2 are the standard virtual key code values (VK_Xxx constants) defined in the WinTypes unit. Shift1 and Shift2 represent the shift-state flag values (ss_xxx constants) associated with Key1 and Key2 respectively. See AddCommand for information about the shift-state flags. ccCommand is the command assigned to the key sequence.

The following example reads the table name and two command records from the SAMPLE.CMD text file, assigns 'Default' to the TableName property, and inserts the command records into the internal command record list.

Contents of SAMPLE.CMD:

Default

37   0   0   0    23

39   0   0   0    32

...

LoadCommandTable('SAMPLE.CMD');

See also: AddCommand, SaveCommandTable


TOvcCommandProcessor.ResetCommandProcessor
ResetCommandProcessor method

procedure TOvcCommandProcessor.ResetCommandProcessor;

ResetCommandProcessor re-initializes the command processor.

This procedure re-initializes the command processor for the next call to Translate or TranslateUsing. ResetCommandProcessor is called to ensure that previous partial commands are cleared (for example, the partial commands involved with WordStar style key sequences).

See also: Translate, TranslateUsing


TOvcCommandProcessor.SaveCommandTable
SaveCommandTable virtual method

procedure TOvcCommandProcessor.SaveCommandTable(const TableName, FileName : string); virtual;

SaveCommandTable saves a command table to a text file.

This procedure writes the name and command-key assignments from TableName to the text file specified by FileName. The format of the resulting file is shown in LoadCommandTable. If the specified TableName does not exist, an ETableNotFound exception is raised.

If a file with the same name already exists, it is overwritten without warning.

The following example writes the contents of the DEFAULT command table to a text file named MYTABLE.CMD.

SaveCommandTable('DEFAULT', 'MYTABLE.CMD');

See also: LoadCommandTable


TOvcCommandProcessor.SetScanPriority
SetScanPriority method

procedure TOvcCommandProcessor.SetScanPriority(Names : array of string);

SetScanPriority reorders the list of command tables.

This procedure is used to change the order in which the command tables are scanned. Names is a string array containing table names in the desired scan order. The strings contained in Names are not case sensitive. If a specified table name does not exist, an ETableNotFound exception is raised.

The following example rearranges the command tables so that MYTABLE is scanned first, followed by DEFAULT and WORDSTAR. It assumes that all three of the command tables are contained in the list of command tables.

SetScanPriority(['MYTABLE', 'DEFAULT', 'WORDSTAR']);

See also: TranslateUsing


TOvcCommandProcessor.Table
Table run-time property

property TOvcCommandProcessor.Table[Index : Integer] : TOvcCommandTable

Table allows access to command tables.

The Table property allows access to the command tables stored in the command processor object.

The following example gets a pointer to the first command table if there is at least one table in the command processor.

var

  CT : TOvcCommandTable;

...

if Count > 0 then

  CT := Table[0];

See also: Count


TOvcCommandProcessor.Translate
Translate method

function TOvcCommandProcessor.Translate(var Msg : TMessage) : Word;

Translate converts Windows messages to commands.

This method is used to convert one of several types of Windows messages into a command recognizable by other components. TMessage is defined in the Delphi Messages unit.

Msg can be the message result from receiving any one of the following Windows messages:

WM_CHAR

WM_KEYDOWN

WM_SYSKEYDOWN

The following example translates WM_KEYDOWN messages into commands.

procedure TEntryField.WMKeyDown(var Msg : TWMKeyDown);

var

  Cmd : Word;

begin

  {see if this command should be processed by us}

  Cmd := Controller.EntryCommands.Translate(TMessage(Msg));

  if Cmd <> ccNone then

    {do something with the command}

  else

    inherited;

end;

See also: ResetCommandProcessor, TranslateUsing


TOvcCommandProcessor.TranslateUsing
TranslateUsing method

function TOvcCommandProcessor.TranslateUsing(Tables : array of string; var Msg : TMessage) : Word;

TranslateUsing translates a message into a command using the supplied tables.

This function is used instead of the normal Translate method when you want to translate a message into a command but don't want to use the current scan order. Call TranslateUsing, passing it the names of the command tables in the order you want them scanned. If you need to use the same scan order for several calls, you should first call SetScanPriority and then use Translate, because Translate is slightly faster than TranslateUsing.

All command tables specified in the Tables parameter are scanned regardless of the state of each command table's Active property. Therefore, this method can be used to force the scanning of tables that would not be scanned by Translate. If a specified table name does not exist, an ETableNotFound exception is raised.

TMessage is defined in the Delphi Messages unit.

The following example finds the command corresponding to the message stored in Msg and assigns the result to the Cmd variable. The 'WORDSTAR' command table is scanned first.

var

  Cmd : Word;

...

Cmd := TranslateUsing(['WORDSTAR', DEFAULT'], Msg)

See also: ResetCommandProcessor, SetScanPriority, Translate


TOvcCommandProcessor.methods
TOvcCommandProcessor methods

Add	Exchange

AddCommand	FieldAddress

AddCommandRec	Free

Assign	FreeInstance

AssignTo 	GetCommandCount

ChangeTableName	GetCommandTable

ClassInfo	GetCommandTableIndex

ClassName	InheritsFrom

ClassParent	InitInstance

ClassType	InstanceSize

Clear	LoadCommandTable

Create	MethodAddress

CreateCommandTable	MethodName

DefaultHandler	NewInstance

Delete	ResetCommandProcessor

DeleteCommand	SaveCommandTable

DeleteCommandTable	SetScanPriority

Destroy	Translate

Dispatch	TranslateUsing


TOvcCommandProcessor.properties
TOvcCommandProcessor properties

Count 	Table


TOvcController
 TOvcController component

See also: properties, events, methods, hierarchy

Component Overview

The TOvcController serves a crucial role for many of the Orpheus components by providing a central location for error reporting and key-to-command translation.

Many Orpheus components that require user input via the keyboard employ the key-to-command translation facilities provided by the EntryCommands property. The configurable key-to-command translation tables allow you to produce applications that can load and use different command tables instead of the ones compiled into the application.

In some situations it might be necessary to attach components from several forms to a common controller on a different form. The MDIEDIT example project demonstrates how to accomplish this. Basically, components are attached to the common controller at run time.


TOvcController hierarchy


TOvcController.AllowMove
AllowMove property

property TOvcController.AllowMove : Boolean

AllowMove determines if components can be moved using the mouse.

If AllowMove is True, components that descend from TOvcBase can be moved using the mouse.

Note: This property is only available when the conditional define, "MoveableComponents" (in OVC.INC) is defined.

See Also: OnControlMove


TOvcController.BtnCancel
BtnCancel property

property TOvcController.BtnCancel : TButton

BtnCancel is the button that entry fields treat as the "cancel" button.

If your form has a button that performs a cancel operation, you can assign it to the BtnCancel property. When an entry field is about to lose the focus, and consequently perform validation of its contents, Orpheus checks to see if the focus is moving to the button specified by BtnCancel. If so, no field validation is performed. This allows the field to be exited and the form to be closed, even if the entry field contains invalid data. No other special action is taken; your program must provide the button actions. See the ADDRBOOK demonstration program for an example of how to use a cancel button.

See also: BtnHelp, BtnRestore, IsSpecialButton


TOvcController.BtnHelp
BtnHelp property

property TOvcController.BtnHelp : TButton

BtnHelp is the button that entry fields treat as the "help" button.

If your form has a button that performs a help operation, you can assign it to the BtnHelp property. When an entry field is about to lose the focus, and consequently perform validation of its contents, Orpheus checks to see if the focus is moving to the button specified by BtnHelp. If so, no field validation is performed. This allows the field to be exited and help to be obtained, even if the entry field contains invalid data. No other special action is taken; your program must provide the button actions.

See also: BtnCancel, BtnRestore, IsSpecialButton


TOvcController.BtnRestore
BtnRestore property

property TOvcController.BtnRestore : TButton

BtnRestore is the button that entry fields treat as the "restore" button.

If your form has a button that performs a restore operation, you can assign it to the BtnRestore property. When an entry field is about to lose the focus, and consequently perform validation of its contents, Orpheus checks to see if the focus is moving to the button specified by BtnRestore. If so, no field validation is performed. This allows the field to be exited and its value to be restored, even if the entry field contains invalid data. No other special action is taken; your program must provide the button actions.

See also: BtnCancel, BtnHelp, IsSpecialButton


TOvcController.EntryCommands
EntryCommands property

property TOvcController.EntryCommands : TOvcCommandProcessor

Default: default command tables

EntryCommands provides keystroke to command translation.

The EntryCommands property is published for use by other Orpheus components. It provides access to a common command processor that can be used by several components at the same time. The property editor associated with this property allows you to manipulate all aspects of the command tables.


TOvcController.ErrorPending
ErrorPending run-time property

property TOvcController.ErrorPending : Boolean

Default: False

ErrorPending indicates whether an entry field has generated an error.

This property is set to True when an Orpheus entry field fails validation or False if the field validation detects no errors. Other components, such as the notebook and table, use this property to detect errors in components that they own.


TOvcController.Handle
Handle run-time read-only property

property TOvcController.Handle : hWnd

Handle is the window handle of this component.


TOvcController.InsertMode
InsertMode run-time property

property TOvcController.InsertMode : Boolean

Default: True

InsertMode indicates insert or overwrite mode.

This property is checked by the entry field and the editor components each time they receive the focus to determine the insert/overwrite state. It also allows the insert/overwrite state of all components using this controller to be changed when any one component changes its insert/overwrite state.


TOvcController.IsSpecialButton
IsSpecialButton method

function TOvcController.IsSpecialButton(H : hWnd) : Boolean;

IsSpecialButton determines whether the specified window handle is one of the button components for a special button.

IsSpecialButton returns True if H is the window handle for one of the button components specified by the BtnCancel, BtnHelp, or BtnRestore properties.

See also: BtnCancel, BtnHelp, BtnRestore


TOvcController.MarkAsUninitialized
MarkAsUninitialized method

procedure TOvcController.MarkAsUninitialized(Uninitialized : Boolean);

MarkAsUninitialized flags all entry fields as uninitialized.

This method cycles through all entry field components on the form, setting their Uninitialized property to the value contained in the Uninitialized parameter.

This method sets the Uninitialized property for all fields on the form at the same time. If you don't need to set the Uninitialized property for all fields at once, you can directly set the Uninitialized property for the necessary fields.

See also: TOvcBaseEntryField.Uninitialized


TOvcController.OnControlMove

property TOvcController.OnControlMove : TNotifyEvent

OnControlMove defines an event handler that is called when a component is moved.

The method assigned to the OnControlMove event is called by Orpheus components when they are moved using the mouse and again when they stop moving.

Note: This event is only available when the conditional define, "MoveableComponents" (in OVC.INC) is defined.

See Also: AllowMove


TOvcController.OnError
OnError event

property TOvcController.OnError : TDataErrorEvent

TDataErrorEvent = procedure(Sender : TObject; ErrorCode : Word; const ErrorMessage : string) of object;

OnError defines an event handler that is called when an error occurs.

The method assigned to the OnError event is called by Orpheus entry fields when field validation (or user validation) detects an error. Sender is the object that generated the error. ErrorCode is one of the error codes defined in the OvcData unit or a user-defined error value. ErrorMessage is a string that describes the error.

The following example displays an error reporting dialog that informs the user of an error generated by an entry field.

procedure TForm1.OvcController1Error(Sender : TObject; ErrorCode : Word;

                                     ErrorMessage : string);

var

  ErrorDlg : TErrorDlg;

begin

  ErrorDlg := TErrorDlg.Create(Self);

  {set appropriate ErrorDlg fields to describe the error}

  try

    ErrorDlg.ShowModal;

  finally

    ErrorDlg.Free;

  end;

end;

...

OvcController1.OnError := OvcController1Error;

See also: TOvcBaseEntryField.Controller


TOvcController.OnPostEdit
OnPostEdit event

property TOvcController.OnPostEdit : TPostEditEvent

TPostEditEvent = procedure(Sender : TObject; GainingControl : TWinControl) of object;

OnPostEdit defines an event handler that is called when the focus changes.

The method assigned to the OnPostEdit event is called to provide notification when an entry field component is about to lose the focus. Sender is the component losing the focus. GainingControl is the component that is about to receive the focus, or nil if there is no gaining control.

Use the OnPostEdit event when you perform the same post-focus processing actions for multiple entry field components. If you need to perform post-focus processing for a single entry field component, use the its OnExit event.

When this event is called, Windows has not yet completed the current focus change. Therefore, you cannot perform any actions that will cause another focus change, such as displaying another form. If you need to force the focus elsewhere, post a WM_NEXTDLGCTL message to the parent form. This allows the current focus change to complete before the requested change is carried out.

The following example displays the name of the entry field that is losing the focus.

procedure TForm1.OvcController1PostEdit(Sender : TObject;

                                        GainingControl : TWinControl);

begin

  Panel2.Caption := 'PostEdit for: ' + (Sender as TOvcBaseEntryFiled).Name;

end;

See also: OnPreEdit


TOvcController.OnPreEdit
OnPreEdit event

property TOvcController.OnPreEdit : TPreEditEvent

TPreEditEvent = procedure(Sender : TObject; LosingControl : TWinControl) of object;

OnPreEdit defines an event handler that is called when the focus changes.

The method assigned to the OnPreEdit event is called to provide notification when an entry field component is about to gain the focus. Sender is the component receiving the focus. LosingControl is the component that is losing the focus, or nil if there is no losing control.

Use the OnPreEdit event when you perform the same pre-focus processing actions for multiple entry field components. If you need to perform pre-focus processing for a single entry field component, use the individual component's OnEnter event.

When this event is called, Windows has not yet completed the current focus change. Therefore, you cannot perform any actions that will cause another focus change, such as displaying another form. If you need to force the focus elsewhere, post a WM_NEXTDLGCTL message to the parent form. This allows the current focus change to complete before the requested change is carried out.

The following example displays the name of the entry field that is gaining the focus.

procedure TForm1.OvcController1PreEdit(Sender : TObject;

                                       LosingControl : TWinControl);

begin

  Panel1.Caption := 'PreEdit for: ' + (Sender as TOvcBaseEntryField).Name;

end;

See also: OnPostEdit


TOvcController.ValidateEntryFields
ValidateEntryFields method

function TOvcController.ValidateEntryFields : TComponent;

ValidateEntryFields asks each entry field to validate its contents.

The ValidateEntryFields method cycles through all the components on the form looking for any Orpheus entry fields. When one is found, ValidateEntryFields asks the entry field to validate itself. If the result of the validation is an error, ValidateEntryFields stops cycling through the components and returns the entry field component that reported the error. If there are no entry fields on the form or if all entry fields are valid, ValidateEntryFields returns nil.

If an error is detected, it is reported via default error handling or by calling the OnError event handler. The focus is moved to the field that generated the error.

This method is typically used to verify that all entry fields on the form contain valid data prior to actually closing the form and processing its data. Your code should exit and allow the user to correct the error if ValidateEntryFields returns a non-nil value.

See also: TOvcBaseEntryField.ValidateSelf


TOvcController.events
TOvcController events

OnControlMove	OnPostEdit

OnError	OnPreEdit


TOvcController.methods
TOvcController methods

Assign	InheritsFrom

AssignTo 	InitInstance

ChangeName 	InsertComponent

ClassInfo	InstanceSize

ClassName	IsSpecialButton

ClassParent	Loaded

ClassType	MarkAsUninitialized

Create	MethodAddress

DefaultHandler	MethodName

DefineProperties 	NewInstance

Destroy	ReadState

DestroyComponents	RemoveComponent

Destroying	SetDesigning

Dispatch	SetName

FieldAddress	ValidateEntryFields

FindComponent	ValidateRename

Free	WriteComponents

FreeInstance	WriteState

HasParent


TOvcController.properties
TOvcController properties

AllowMove 	DesignInfo

BtnCancel	EntryCommands

BtnHelp	ErrorPending

BtnRestore	Handle

ComponentCount 	InsertMode

ComponentIndex 	Name

Components 	Owner

ComponentState 	Tag


TOvcDBEditor
 TOvcDBEditor component

See also: properties, events, methods, hierarchy

Component Overview

TOvcDbEditor is a direct descendant of the TOvcCustomEditor and inherits all of its properties and methods (these are the same properties and methods documented for the TOvcEditor).

There are very few differences in the behavior of the TOvcDbEditor and TOvcEditor except that TOvcDbEditor is capable of connecting to a data source and editing the text of a memo field.

TOvcDbEditor provides four additional properties. AutoUpdate allows you to configure the editor to automatically update the data source whenever the editor loses the focus. The DataField, DataSource, and Field properties are exactly the same as the like-named properties in Delphi's standard data-aware components.

Using a TOvcDbEditor component is very simple--assign a TDataSource to the DataSource property and assign a memo field name to the DataField property. The editor automatically gets the text to edit from the data field and optionally updates the data source with the changed data.

The TOvcDbEditor is limited to 32,767 lines of text, unlike its ancestor which is limited only by the amount of the Windows global heap. If your database memo field contains 40-character lines, this would mean that the data-aware editor could edit the field contents as long as it does not contain more than 1.3 million characters.


TOvcDBEditor hierarchy


TOvcDBEditor.AutoUpdate
AutoUpdate property

property TOvcDBEditor.AutoUpdate : Boolean

Default: True

AutoUpdate determines whether the data source is updated when the editor loses the focus.

If AutoUpdate is True, the editor component automatically calls UpdateRecord for the attached DataSource when it loses the focus. Set it to False if you update the data source explicitly.


TOvcDBEditor.DataField
DataField property

property TOvcDBEditor.DataField : string

DataField identifies the field (in the data source component) from which the editor component displays data.


TOvcDBEditor.DataSource
DataSource property

property TOvcDBEditor.DataSource : TDataSource

DataSource specifies the data source component where the editor obtains the data to display.


TOvcDBEditor.Field
Field run-time read-only property

property TOvcDBEditor.Field : TField

Field returns the TField object to which the editor component is linked.

Use the Field object when you want to change the value of the data in the field programmatically.


TOvcDBEditor.events
TOvcDBEditor events

OnClick	OnKeyDown

OnDblClick	OnKeyPress

OnDragDrop	OnKeyUp

OnDragOver	OnMouseDown

OnEndDrag	OnMouseMove

OnEnter	OnMouseUp

OnError	OnShowStatus

OnExit	OnUserCommand


TOvcDBEditor.methods
TOvcDBEditor methods

AlignControls 	HandleNeeded

AppendPara	HasParent

Assign	Hide

AssignTo 	InheritsFrom

Attach	InitInstance

BeginDrag	Insert

BringToFront	InsertComponent

Broadcast	InsertControl

CanFocus	InstanceSize

CanRedo	Invalidate

CanUndo	IsControlMouseMsg

ChangeName 	KeyDown

ChangeScale 	KeyPress

ClassInfo	KeyUp

ClassName	LineToPara

ClassParent	Loaded

ClassType	MainWndProc

Clear	MethodAddress

ClearMarker	MethodName

Click 	MouseDown

ClientToScreen	MouseMove

ContainsControl	MouseUp

ControlAtPos	NewInstance

CopyToClipboard	NotifyControls

Create	PaintControls

CreateHandle 	PaintHandler

CreateSubClass 	PaintWindow

CreateWindowHandle 	PaletteChanged

CutToClipboard	ParaCount

DblClick 	ParaToLine

DefaultHandler 	PasteFromClipboard

DefineProperties 	Perform

DeleteAll	ProcessCommand

Destroy	ReadState

DestroyComponents	Realign

DestroyHandle 	RecreateWnd

Destroying	Redo

DestroyWindowHandle 	Refresh

DestroyWnd 	RemoveComponent

DisableAlign	RemoveControl

Dispatch	Repaint

DoEnter 	Replace

DoExit 	ResetScrollBars

DoKeyDown 	ScaleBy

DoKeyPress 	ScaleControls

DoKeyUp 	ScreenToClient

DragCanceled 	ScrollBy

Dragging	Search

EffectiveColumn	SelectAll

EnableAlign	SelectFirst

EndDrag	SelectNext

FieldAddress	SendToBack

FindComponent	SetBounds

FindNextControl 	SetCaretPosition

FlushUndoBuffer	SetDesigning

Focused	SetFocus

Free	SetMarker

FreeInstance	SetMarkerAt

GetCaretPosition	SetName

GetClientOrigin 	SetParent

GetClientRect 	SetSelection

GetDeviceContext 	SetText

GetLine	SetTextBuf

GetMarkerPosition	SetZOrder

GetPalette 	Show

GetPara	ShowControl

GetPrintableLine	Undo

GetSelection	Update

GetTabOrderList	UpdateBoundsRect

GetText	ValidateRename

GetTextBuf	VisibleChanging

GetTextLen	WndProc

GotoMarker	WriteComponents

HandleAllocated	WriteState


TOvcDBEditor.properties
TOvcDBEditor properties

Align	LineCount

AutoIndent	LineLength

AutoUpdate	Lines

BorderStyle	Margin

BoundsRect 	Modified

Brush 	MouseCapture

ByteLimit	Name

Canvas  	NextEditor

Caption  	Owner

CaretIns	ParaLength

CaretOvr	ParaLengthLimit

ClientHeight 	ParaLimit

ClientOrigin 	ParaPointer

ClientRect 	Parent

ClientWidth 	ParentColor

Color	ParentCtl3D

ComponentCount 	ParentFont

ComponentIndex 	ParentShowHint

Components 	PopupMenu

ComponentState 	PrevEditor

ControlCount 	ReadOnly

Controller	ScrollBars

Controls 	ScrollBarsAlways

ControlState 	ScrollPastEnd

ControlStyle 	ShowBookmarks

Ctl3D	ShowHint

Cursor	Showing

DataField	TabOrder

DataSource	TabSize

DefWndProc  	TabStop

DesignInfo 	TabType

DragCursor	Tag

DragMode	Text

Enabled	TextLength

Field 	Top

FirstEditor 	TopLine

FixedFont	UndoBufferSize

Font  	Visible

Handle 	VisibleColumns

Height	WantEnter

HelpContext	WantTab

HideSelection	Width

HighlightColors	WindowHandle

Hint	WordWrap

InsertMode	WrapAtLeft

IsControl  	WrapColumn

Left


TOvcDbNumericField
 TOvcDbNumericField component

See also: properties, events, methods, hierarchy

Component Overview

TOvcDbNumericField is a direct descendant of TOvcCustomNumericField and inherits all of its properties and methods. These properties and methods are documented in the TOvcNumericField component help topics.

There are very few differences in the behavior of the TOvcDbNumericField and TOvcNumericField except that TOvcDbNumericField is capable of connecting to a data source and editing the contents of several types of database fields. It can edit fields of the following Delphi types:

ftCurrency

ftSmallInt

ftInteger

ftWord

ftFloat

TOvcDbNumericField provides four additional properties. The DataField, DataSource, Field, and FieldType properties are exactly the same as the like-named properties in Delphi's standard data-aware components. The FieldType property is set automatically when the TOvcDbNumericField is connected to an active data source and assigned a field name.

Using a TOvcDbNumericField component is very simple--assign a TDataSource to the DataSource property and assign an appropriate field name to the DataField property. The entry field automatically gets the database value and updates the data source with the changed data when the field loses the focus.


TOvcDbNumericField hierarchy


TOvcDbNumericField.DataField
DataField property

property TOvcDbNumericField.DataField : string

DataField identifies the field (in the data source component) from which the entry field component displays data.


TOvcDbNumericField.DataSource
DataSource property

property TOvcDbNumericField.DataSource : TDataSource

DataSource specifies the data source component where the entry field obtains the data to display.


TOvcDbNumericField.Field
Field run-time read-only property

property TOvcDbNumericField.Field: TField

Field returns the TField object to which the entry field component is linked.

Use the Field object to change the value of the data in the field programmatically.


TOvcDbNumericField.FieldType
FieldType property

property TOvcDbNumericField.FieldType : TFieldType

TFieldType = (ftUnknown, ftString, ftSmallint, ftInteger, ftWord, ftBoolean, ftFloat, ftCurrency, ftBCD, ftDate, ftTime, ftDateTime, ftBytes, ftVarBytes, ftBlob, ftMemo, ftGraphic);

Default: ftUnknown

FieldType determines the type of the database field.

When a data-aware entry field is attached to an active data source and the DataField property is set to the name of the field, this property is automatically set to match the data type of the database field. If it is not desirable to activate the data source, this field must be set to the correct field type so that the Orpheus entry field can configure its internal data type and initialize the picture mask.

The data-aware entry fields do not support all of the possible database field types shown in the definition of TFieldType (see the Delphi DB unit). If you select one that is not supported, an error message is displayed. For example, if the ftGraphic field type is selected, an error is displayed because none of the data-aware entry fields support that field type.

See also: DataField, DataSource


TOvcDbNumericField.events
TOvcDbNumericField events

OnChange	OnKeyDown

OnClick	OnKeyPress

OnDblClick	OnKeyUp

OnDragDrop	OnMouseDown

OnDragOver	OnMouseMove

OnEndDrag	OnMouseUp

OnEnter	OnUserCommand

OnError	OnUserValidation

OnExit


TOvcDbNumericField.methods
TOvcDbNumericField methods

AlignControls 	IncreaseValue

Assign	InheritsFrom

AssignTo 	InitInstance

BeginDrag	InsertComponent

BringToFront	InsertControl

Broadcast	InstanceSize

CanFocus	Invalidate

ChangeName 	IsControlMouseMsg

ChangeScale 	IsValid

ClassInfo	KeyDown

ClassName	KeyPress

ClassParent	KeyUp

ClassType	Loaded

ClearContents	MainWndProc

ClearSelection	MethodAddress

Click 	MethodName

ClientToScreen	MouseDown

ContainsControl	MouseMove

ControlAtPos	MouseUp

CopyToClipboard	MoveCaret

Create	NewInstance

CreateHandle 	NotifyControls

CreateSubClass 	PaintControls

CreateWindowHandle 	PaintHandler

CutToClipboard	PaintWindow

DblClick 	PaletteChanged

DecreaseValue	PasteFromClipboard

DefaultHandler 	Perform

Destroy	ReadState

DestroyComponents	Realign

DestroyHandle 	RecreateWnd

Destroying	Refresh

DestroyWindowHandle 	RemoveComponent

DestroyWnd 	RemoveControl

DisableAlign	Repaint

Dispatch	ScaleBy

DoEnter 	ScaleControls

DoExit 	ScreenToClient

DoKeyDown 	ScrollBy

DoKeyPress 	SelectAll

DoKeyUp 	SelectFirst

DragCanceled 	SelectNext

Dragging	SendToBack

EnableAlign	SetBounds

EndDrag	SetDesigning

FieldAddress	SetFocus

FieldIsEmpty	SetInitialValue

FindComponent	SetParent

FindNextControl 	SetRangeHi

Focused	SetRangeLo

Free	SetSelection

FreeInstance	SetTextBuf

GetClientOrigin 	SetValue

GetClientRect 	SetZOrder

GetDeviceContext 	Show

GetPalette 	ShowControl

GetTabOrderList	Update

GetTextBuf	UpdateBoundsRect

GetTextLen	ValidateRename

GetValue	ValidateSelf

HandleAllocated	VisibleChanging

HandleNeeded	WndProc

HasParent 	WriteComponents

Hide	WriteState


TOvcDbNumericField.properties
TOvcDbNumericField properties

Align 	EverModified

AsBoolean 	Field

AsCents 	FieldType

AsDateTime 	Font

AsExtended 	ForceInsert

AsFloat 	ForceOvertype

AsInteger 	Handle

AsOvcDate 	Height

AsOvcTime 	HelpContext

AsString 	HighlightColors

AutoAdvanceChar	Hint

AutoAdvanceLeftRight	InputRequired

AutoAdvanceUpDown	InsertPushes

AutoSelect	IntlSupport

AutoSize	IsControl

BeepOnError	LastError

BorderStyle	Left

BoundsRect 	MaxLength

Brush 	Modified

Canvas  	MouseCapture

Caption  	Name

CaretIns	Owner

CaretOvr	PadChar

CaretToEnd  	Parent

ClientHeight 	ParentColor

ClientOrigin 	ParentCtl3D

ClientRect 	ParentFont

ClientWidth 	ParentShowHint

Color	PasswordChar

ComponentCount 	PasswordMode

ComponentIndex 	PictureMask

Components 	PopupMenu

ComponentState 	RangeHi

ControlCharColor  	RangeLo

ControlCount 	ReadOnly

Controller	RightJustify

Controls 	SelectedText

ControlState 	SelectionLength

ControlStyle 	SelectionStart

Ctl3D	ShowHint

CurrentPos 	Showing

Cursor	SoftValidation

DataField	StripLiterals

DataSize 	TabOrder

DataSource	TabStop

DataType  	Tag

DecimalPlaces  	Text

DefWndProc  	Top

DesignInfo 	TrimBlanks

DisplayString 	Uninitialized

DragCursor	UserData

DragMode	Visible

EditString 	Width

Enabled	WindowHandle

ErrorColors


TOvcDbPictureField
 TOvcDbPictureField component

See also: properties, events, methods, hierarchy

Component Overview

TOvcDbPictureField is a direct descendant of TOvcCustomPictureField and inherits all of its properties and methods. These properties and methods are documented in the TOvcPictureField component help topics.

The primary differences in the behavior of the TOvcDbPictureField and TOvcPictureField are that TOvcDbPictureField is capable of connecting to a data source and editing the contents of several types of database fields. It can edit fields of the following Delphi types:

ftString

ftSmallInt

ftInteger

ftWord

ftBoolean

ftFloat

ftCurrency

ftDate

ftTime

ftDateTime

TOvcDbPictureField provides five additional properties. The DataField, DataSource, DateOrTime, Field, FieldType properties are exactly the same as the like-named properties in Delphi's standard data-aware components. A FieldType property is set automatically when the TOvcDbPictureField is connected to an active data source and assigned a field name.

Using a TOvcDbPictureField component is very simple--assign a TDataSource to the DataSource property and assign an appropriate field name to the DataField property. The entry field automatically gets the database value and updates the data source with the changed data when the field loses the focus.


TOvcDbPictureField hierarchy


TOvcDbPictureField.DataField
DataField property

property TOvcDbPictureField.DataField : string

DataField identifies the field (in the data source component) from which the entry field component displays data.


TOvcDbPictureField.DataSource
DataSource property

property TOvcDbPictureField.DataSource : TDataSource

DataSource specifies the data source component where the entry field obtains the data to display.


TOvcDbPictureField.DateOrTime
DateOrTime property

property TOvcDbPictureField.DateOrTime : TDateOrTime

TDateOrTime = (ftUseDate, ftUseTime);

Default: ftUseDate

DateOrTime determines whether ftDateTime database fields are edited as dates or times.

Orpheus does not provide an entry field capable of editing both dates and times. This property is used when the data-aware field is connected to an ftDateTime field to determine which of the two to edit.

If DateOrTime is ftUseDate, the entry field edits the date portion of the ftDateTime value. If it is ftUseTime, the entry field edits the time portion of the ftDateTime value. In both cases, the portion of the ftDateTime field that is not edited will always be zero after the entry field updates the data source.


TOvcDbPictureField.Field
Field run-time read-only property

property TOvcDbPictureField.Field: TField

Field returns the TField object to which the entry field component is linked.

Use the Field object when you want to change the value of the data in the field programmatically.


TOvcDbPictureField.FieldType
FieldType property

property TOvcDbPictureField.FieldType : TFieldType

TFieldType = (ftUnknown, ftString, ftSmallint, ftInteger, ftWord, ftBoolean, ftFloat, ftCurrency, ftBCD, ftDate, ftTime, ftDateTime, ftBytes, ftVarBytes, ftBlob, ftMemo, ftGraphic);

Default: ftUnknown

FieldType determines the type of the database field.

When a data-aware entry field is attached to an active data source and the DataField property is set to the name of the field, this property is automatically set to match the data type of the database field. If it is not desirable to activate the data source, this field must be set to the correct field type so that the Orpheus entry field can configure its internal data type and initialize the picture mask.

The data-aware entry fields do not support all of the possible database field types shown in the definition of TFieldType (see the Delphi DB unit). If you select one that is not supported, an error message is displayed. For example, if the ftGraphic field type is selected, an error is displayed because none of the data-aware entry fields support that field type.

See also: DataField, DataSource


TOvcDbPictureField.events
TOvcDbPictureField events

OnChange	OnKeyDown

OnClick	OnKeyPress

OnDblClick	OnKeyUp

OnDragDrop	OnMouseDown

OnDragOver	OnMouseMove

OnEndDrag	OnMouseUp

OnEnter	OnUserCommand

OnError	OnUserValidation

OnExit


TOvcDbPictureField.methods
TOvcDbPictureField methods

AlignControls 	IncreaseValue

Assign	InheritsFrom

AssignTo 	InitInstance

BeginDrag	InsertComponent

BringToFront	InsertControl

Broadcast	InstanceSize

CanFocus	Invalidate

ChangeName 	IsControlMouseMsg

ChangeScale 	IsValid

ClassInfo	KeyDown

ClassName	KeyPress

ClassParent	KeyUp

ClassType	Loaded

ClearContents	MainWndProc

ClearSelection	MethodAddress

Click 	MethodName

ClientToScreen	MouseDown

ContainsControl	MouseMove

ControlAtPos	MouseUp

CopyToClipboard	MoveCaret

Create	NewInstance

CreateHandle 	NotifyControls

CreateSubClass 	PaintControls

CreateWindowHandle 	PaintHandler

CutToClipboard	PaintWindow

DblClick 	PaletteChanged

DecreaseValue	PasteFromClipboard

DefaultHandler 	Perform

Destroy	ReadState

DestroyComponents	Realign

DestroyHandle 	RecreateWnd

Destroying	Refresh

DestroyWindowHandle 	RemoveComponent

DestroyWnd 	RemoveControl

DisableAlign	Repaint

Dispatch	ScaleBy

DoEnter 	ScaleControls

DoExit 	ScreenToClient

DoKeyDown 	ScrollBy

DoKeyPress 	SelectAll

DoKeyUp 	SelectFirst

DragCanceled 	SelectNext

Dragging	SendToBack

EnableAlign	SetBounds

EndDrag	SetDesigning

FieldAddress	SetFocus

FieldIsEmpty	SetInitialValue

FindComponent	SetParent

FindNextControl 	SetRangeHi

Focused	SetRangeLo

Free	SetSelection

FreeInstance	SetTextBuf

GetClientOrigin 	SetValue

GetClientRect 	SetZOrder

GetDeviceContext 	Show

GetPalette 	ShowControl

GetTabOrderList	Update

GetTextBuf	UpdateBoundsRect

GetTextLen	ValidateRename

GetValue	ValidateSelf

HandleAllocated	VisibleChanging

HandleNeeded	WndProc

HasParent 	WriteComponents

Hide	WriteState


TOvcDbPictureField.properties
TOvcDbPictureField properties

Align 	EverModified

AsBoolean 	Field

AsCents 	FieldType

AsDateTime 	Font

AsExtended 	ForceInsert

AsFloat 	ForceOvertype

AsInteger 	Handle

AsOvcDate 	Height

AsOvcTime 	HelpContext

AsString 	HighlightColors

AutoAdvanceChar	Hint

AutoAdvanceLeftRight	InputRequired

AutoAdvanceUpDown	InsertPushes

AutoSelect	IntlSupport

AutoSize	IsControl

BeepOnError	LastError

BorderStyle	Left

BoundsRect 	MaxLength

Brush 	Modified

Canvas  	MouseCapture

Caption  	Name

CaretIns	Owner

CaretOvr	PadChar

CaretToEnd	Parent

ClientHeight 	ParentColor

ClientOrigin 	ParentCtl3D

ClientRect 	ParentFont

ClientWidth 	ParentShowHint

Color	PasswordChar

ComponentCount 	PasswordMode

ComponentIndex 	PictureMask

Components 	PopupMenu

ComponentState 	RangeHi

ControlCharColor	RangeLo

ControlCount 	ReadOnly

Controller	RightJustify

Controls 	SelectedText

ControlState 	SelectionLength

ControlStyle 	SelectionStart

Ctl3D	ShowHint

CurrentPos 	Showing

Cursor	SoftValidation

DataField	StripLiterals

DataSize 	TabOrder

DataSource	TabStop

DataType 	Tag

DateOrTime	Text

DecimalPlaces 	Top

DefWndProc  	TrimBlanks

DesignInfo 	Uninitialized

DisplayString 	UserData

DragCursor	Visible

DragMode	Width

EditString 	WindowHandle

Enabled

ErrorColors


TOvcDbSimpleField
 TOvcDbSimpleField component

See also: properties, events, methods, hierarchy

Component Overview

TOvcDbSimpleField is a direct descendant of TOvcCustomSimpleField and inherits all of its properties and methods. These properties and methods are documented in the TOvcSimpleField component help topics.

The primary differences in the behavior of the TOvcDbSimpleField and TOvcSimpleField are that TOvcDbSimpleField is capable of connecting to a data source and editing the contents of several types of database fields. It can edit fields of the following Delphi types:

ftString

ftSmallInt

ftInteger

ftWord

ftBoolean

ftFloat

TOvcDbSimpleField provides four additional properties. The DataField, DataSource, Field, and FieldType properties are exactly the same as the like-named properties in Delphi's standard data-aware components. The FieldType property is set automatically when the TOvcDbSimpleField is connected to an active data source and assigned a field name.

Using a TOvcDbSimpleField component is very simple--assign a TDataSource to the DataSource property and assign an appropriate field name to the DataField property. The entry field automatically gets the database value and updates the data source with the changed data when the field loses the focus.


TOvcDbSimpleField hierarchy


TOvcDbSimpleField.DataField
DataField property

property TOvcDbSimpleField.DataField : string

DataField identifies the field (in the data source component) from which the entry field component displays data.


TOvcDbSimpleField.DataSource
DataSource property

property TOvcDbSimpleField.DataSource : TDataSource

DataSource specifies the data source component where the entry field obtains the data to display.


TOvcDbSimpleField.Field
Field run-time read-only property

property TOvcDbSimpleField.Field: TField

Field returns the TField object to which the entry field component is linked.

Use the Field object to change the value of the data in the field programmatically.


TOvcDbSimpleField.FieldType
FieldType property

property TOvcDbSimpleField.FieldType : TFieldType

TFieldType = (ftUnknown, ftString, ftSmallint, ftInteger, ftWord, ftBoolean, ftFloat, ftCurrency, ftBCD, ftDate, ftTime, ftDateTime, ftBytes, ftVarBytes, ftBlob, ftMemo, ftGraphic);

Default: ftUnknown

FieldType determines the type of the database field.

When a data-aware entry field is attached to an active data source and the DataField property is set to the name of the field, this property is automatically set to match the data type of the database field. If it is not desirable to activate the data source, this field must be set to the correct field type so that the Orpheus entry field can configure its internal data type and initialize the picture mask.

The data-aware entry fields do not support all of the database field types shown in the definition of TFieldType (see the Delphi DB unit). If you select one that is not supported, an error message is displayed. For example, if the ftGraphic field type is selected, an error is displayed because none of the data-aware entry fields support that field type.

See also: DataField, DataSource


TOvcDbSimpleField.events
TOvcDbSimpleField events

OnChange	OnKeyDown

OnClick	OnKeyPress

OnDblClick	OnKeyUp

OnDragDrop	OnMouseDown

OnDragOver	OnMouseMove

OnEndDrag	OnMouseUp

OnEnter	OnUserCommand

OnError	OnUserValidation

OnExit


TOvcDbSimpleField.methods
TOvcDbSimpleField methods

AlignControls 	IncreaseValue

Assign	InheritsFrom

AssignTo 	InitInstance

BeginDrag	InsertComponent

BringToFront	InsertControl

Broadcast	InstanceSize

CanFocus	Invalidate

ChangeName 	IsControlMouseMsg

ChangeScale 	IsValid

ClassInfo	KeyDown

ClassName	KeyPress

ClassParent	KeyUp

ClassType	Loaded

ClearContents	MainWndProc

ClearSelection	MergeWithPicture

Click 	MethodAddress

ClientToScreen	MethodName

ContainsControl	MouseDown

ControlAtPos	MouseMove

CopyToClipboard	MouseUp

Create	MoveCaret

CreateHandle 	NewInstance

CreateSubClass 	NotifyControls

CreateWindowHandle 	PaintControls

CutToClipboard	PaintHandler

DblClick 	PaintWindow

DecreaseValue	PaletteChanged

DefaultHandler 	PasteFromClipboard

Destroy	Perform

DestroyComponents	ReadState

DestroyHandle 	Realign

Destroying	RecreateWnd

DestroyWindowHandle 	Refresh

DestroyWnd 	RemoveComponent

DisableAlign	RemoveControl

Dispatch	Repaint

DoEnter 	ScaleBy

DoExit 	ScaleControls

DoKeyDown 	ScreenToClient

DoKeyPress 	ScrollBy

DoKeyUp 	SelectAll

DragCanceled 	SelectFirst

Dragging	SelectNext

EnableAlign	SendToBack

EndDrag	SetBounds

FieldAddress	SetDesigning

FieldIsEmpty	SetFocus

FindComponent	SetInitialValue

FindNextControl 	SetParent

Focused	SetRangeHi

Free	SetRangeLo

FreeInstance	SetSelection

GetClientOrigin 	SetTextBuf

GetClientRect 	SetValue

GetDeviceContext 	SetZOrder

GetPalette 	Show

GetStrippedEditString	ShowControl

GetTabOrderList	Update

GetTextBuf	UpdateBoundsRect

GetTextLen	ValidateRename

GetValue	ValidateSelf

HandleAllocated	VisibleChanging

HandleNeeded	WndProc

HasParent 	WriteComponents

Hide	WriteState


TOvcDbSimpleField.properties
TOvcDbSimpleField properties

Align 	EverModified

AsBoolean 	Field

AsCents 	FieldType

AsDateTime 	Font

AsExtended 	ForceInsert

AsFloat 	ForceOvertype

AsInteger 	Handle

AsOvcDate 	Height

AsOvcTime 	HelpContext

AsString 	HighlightColors

AutoAdvanceChar	Hint

AutoAdvanceLeftRight	InputRequired

AutoAdvanceUpDown	InsertPushes

AutoSelect	IntlSupport

AutoSize	IsControl

BeepOnError	LastError

BorderStyle	Left

BoundsRect 	MaxLength

Brush 	Modified

Canvas  	MouseCapture

Caption  	Name

CaretIns	Owner

CaretOvr	PadChar

CaretToEnd	Parent

ClientHeight 	ParentColor

ClientOrigin 	ParentCtl3D

ClientRect 	ParentFont

ClientWidth 	ParentShowHint

Color	PasswordChar

ComponentCount 	PasswordMode

ComponentIndex 	PictureMask

Components 	PopupMenu

ComponentState 	RangeHi

ControlCharColor	RangeLo

ControlCount 	ReadOnly

Controller	RightJustify

Controls 	SelectedText

ControlState 	SelectionLength

ControlStyle 	SelectionStart

Ctl3D	ShowHint

CurrentPos 	Showing

Cursor	SoftValidation

DataField	StripLiterals

DataSize 	TabOrder

DataSource	TabStop

DataType  	Tag

DecimalPlaces	Text

DefWndProc  	Top

DesignInfo 	TrimBlanks

DisplayString 	Uninitialized

DragCursor	UserData

DragMode	Visible

EditString 	Width

Enabled	WindowHandle

ErrorColors


TOvcEditor
 TOvcEditor component

See also: properties, events, methods, hierarchy

Component Overview

When you use the TOvcEditor component, you are responsible for obtaining the text stream from wherever it is stored and loading it into the editor. If you use the TOvcTextFileEditor component, this step is automated for you, but this reduces its flexibility and prevents you from editing text that is embedded in a database record, for example. Similarly, when using the TOvcEditor you must take steps to store the editor text stream back to the desired file.

There are three steps involved in loading data into the TOvcEditor component.

1.  Delete any existing text by calling the DeleteAll method. This can be skipped if the editor component is newly created. It is necessary only when loading new text into an existing editor.

2.  Make repeated calls to the AppendPara function to add each paragraph of text to the editor's linked list of paragraphs. This can be skipped if there is no existing text to be edited.

3.  Call the ResetScrollBars method, which effectively signals that you are finished adding paragraphs to the editor's text stream.

If the text to be edited is in a single contiguous buffer and the end of the text is marked by a terminating null, you can combine these three steps into one by calling the SetText method, passing a pointer to the buffer as the parameter.

Extracting data from the editor is a simpler, two-step process.

1.  Use the ParaCount run-time property to find out how many paragraphs are in the editor's text stream.

2.  Use the ParaPointer indexed property once for each paragraph in the text stream, and either write the contents of the paragraph to disk or make a copy of it.

Caution: Do not store a copy of the pointer returned by the ParaPointer property; it is a pointer to memory owned by the editor, and will be released when the editor component is destroyed.

Although the editor component always assumes that a paragraph is terminated by a carriage return-line feed (CRLF) sequence, it does not actually store these characters. So, when you use AppendPara to add paragraphs, you must remove any trailing CRLF pair before making the call. When extracting paragraphs with ParaPointer, you must account for the assumed CRLF at the end of the paragraph when necessary (e.g., when writing a paragraph out to disk).

For good examples of how to load data into an editor component and get it back, see the source code for the LoadFromFile and SaveToFile methods in the TOvcTextFileEditor component.


TOvcEditor hierarchy


TOvcEditor.AppendPara
AppendPara method

function TOvcEditor.AppendPara(Para : PChar) : Word;

AppendPara appends a string to the end of the internal list of paragraphs.

This method should be used only in conjunction with DeleteAll and ResetScrollBars. That is, when you want to load a new "file" into the text editor, call DeleteAll to delete all existing paragraphs, then call AppendPara in a loop to add each paragraph in the file to the editor, and finally call ResetScrollBars. See the implementation of the TOvcTextFileEditor for an example of this process.

The function result is 0 if AppendPara is successful, otherwise it is an error code (see the OnError event for a list of error codes).

See also: DeleteAll, ResetScrollBars


TOvcEditor.Attach
Attach virtual method

procedure TOvcEditor.Attach(Editor : TOvcCustomEditor); virtual;

Attach is used to attach this editor to another editor's text stream.

Use Attach when you need to allow multiple editors to display the same "file." Once you have obtained an instance pointer to any other editor component that is displaying the file, you can pass the pointer to Attach. Once the two editors are "attached" to each other, any changes in one editor's window are reflected in the other's (as time permits). There is no limit on the number of editors that can be attached. There is no Detach routine to remove an editor from the linked list of attached editors, because calling DeleteAll (or destroying the editor) effectively does so.

See also: DeleteAll


TOvcEditor.AutoIndent
AutoIndent property

property TOvcEditor.AutoIndent : Boolean

Default: False

AutoIndent determines whether automatic indentation for new lines is active.

If AutoIndent is True, a new paragraph created by pressing <Enter> or <CtrlEnter> is given the same indentation level as the last line of the previous paragraph (this is generally useful only when word wrap is off).

See also: TabType


TOvcEditor.BorderStyle
BorderStyle property

property TOvcEditor.BorderStyle : TBorderStyle;

Default: bsSingle

BorderStyle determines the style used when drawing the border.

The possible values are bsSingle (a single line border is drawn around the component) or bsNone (no border line).

The TBorderStyle type is defined in the Delphi Controls unit.


TOvcEditor.ByteLimit
ByteLimit property

property TOvcEditor.ByteLimit : LongInt

Default: MaxLongInt

ByteLimit is the maximum number of bytes (characters) that can be entered into the editor.

This property sets a limit on the total number of bytes of text (including CRLF characters) that can be entered.

The following example sets a total byte limit of 512KB.

Editor1.ByteLimit := (512*1024);


TOvcEditor.CanRedo
CanRedo method

function TOvcEditor.CanRedo : Boolean;

CanRedo returns True if the last undo operation can be redone.

This method returns True if there are any undone operations that can be redone.

CanRedo is typically used in applications that provide a menu item to redo the last operation. If CanRedo returns False, the menu item should be disabled. It is not necessary to call CanRedo before calling Redo.

See also: CanUndo, Redo, Undo


TOvcEditor.CanUndo
CanUndo method

function TOvcEditor.CanUndo : Boolean;

CanUndo returns True if the last change can be undone.

This method returns True if there are any editing operations that can be undone.

CanUndo is typically used in applications that provide a menu item to undo the last operation. If CanUndo returns False, the menu item should be disabled. It is not necessary to call CanUndo before calling Undo.

See also: CanRedo, Redo, Undo


TOvcEditor.CaretIns
CaretIns property

property TOvcEditor.CaretIns : TOvcCaretType

Default: vertical line caret

CaretIns determines the characteristics of the editing caret.

This property allows you to customize the attributes of the editing caret used while the editor is in insert mode. For additional information see TOvcCaret.

See also: CaretOvr


TOvcEditor.CaretOvr
CaretOvr property

property TOvcEditor.CaretOvr : TOvcCaretType

Default: solid block caret

CaretOvr determines the characteristics of the editing caret.

This property allows you to customize the attributes of the editing caret used while the editor is in overwrite mode. For additional information see TOvcCaret.

See also: CaretIns


TOvcEditor.Clear
Clear method

procedure TOvcEditor.Clear;

Clear deletes the current selection.

This method deletes the currently selected region of text. If there is no selection, Clear does nothing.

The following example deletes the currently selected text, if any. (The call to GetSelection is not necessary.)

if GetSelection(Line1, Col1, Line2, Col2) then

  Clear;

See also: CopyToClipboard, CutToClipboard, GetSelection, PasteFromClipboard


TOvcEditor.ClearMarker
ClearMarker method

procedure TOvcEditor.ClearMarker(N : Byte);

ClearMarker clears the specified bookmark.

This method removes the bookmark specified by N. If the bookmark was displayed, the editor is updated to erase the bookmark bitmap. Valid values for N are 0 to 9.

If the bookmark specified by N has not been set, no action is taken.

See also: SetMarker, SetMarkerAt


TOvcEditor.CopyToClipboard
CopyToClipboard method

procedure TOvcEditor.CopyToClipboard;

CopyToClipboard copies the selection to the Windows clipboard.

This method copies the currently selected text to the clipboard. If there is no selection, CopyToClipboard does nothing.

The following example copies the currently selected text, if any, to the clipboard. (The call to GetSelection is not necessary.)

if GetSelection(Line1, Col1, Line2, Col2) then

  CopyToClipboard;

See also: Clear, CutToClipboard, GetSelection, PasteFromClipboard


TOvcEditor.CutToClipboard
CutToClipboard method

procedure TOvcEditor.CutToClipboard;

CutToClipboard copies the selection to the clipboard and then deletes the selected text.

This method copies the currently selected text to the clipboard, then deletes it. If there is no selection, CutToClipboard does nothing.

The following example copies the currently selected text, if any, to the clipboard and then deletes it. (The call to GetSelection is not necessary.)

if GetSelection(Line1, Col1, Line2, Col2) then

  CutToClipboard;

See also: Clear, CopyToClipboard, GetSelection, PasteFromClipboard


TOvcEditor.DeleteAll
DeleteAll method

procedure TOvcEditor.DeleteAll(UpdateScreen : Boolean);

DeleteAll deletes all text in the editor.

This method deletes all text in the editor, detaches it from any list of attached editors to which it belongs, flushes the undo buffer, resets the scroll bars, and clears the editor's modified flag. Passing True for UpdateScreen indicates that the window should be updated.

See also: AppendPara, ResetScrollBars


TOvcEditor.EffectiveColumn
EffectiveColumn method

function TOvcEditor.EffectiveColumn(S : PChar; Col : Integer) : Integer;

EffectiveColumn converts an actual column to an effective column.

Col is the "actual" column number. It indicates the position of the caret within the string, without regard for tab expansion. If the caret is on the fourth character in the current line, the actual column number is 4.

The effective column number is the editor column at which the caret would be placed given the contents of string S, the current tab size, and the actual column number. For example, suppose that the tab size is 8, the Col parameter is 2, and S is a two-character string consisting of a tab character followed by 'A'. EffectiveColumn would return 9 in this case, since the second character in the string is 'A', and 'A' would be displayed in the editor at column 9.

If S contains no tab characters, the actual column and the effective column are the same.

See also: GetCaretPosition


TOvcEditor.FirstEditor
FirstEditor run-time read-only property

property TOvcEditor.FirstEditor : TOvcCustomEditor

FirstEditor returns a pointer to the first attached editor.

This method returns a pointer to the first editor component in the list of editors attached to the current editor. If there are no other editors attached to the current one, FirstEditor returns a pointer to the current editor, and so do NextEditor and PrevEditor, because the list of attached editors is a circular linked list.

The following example shows how to cycle through all attached editors.

First := Editor1.FirstEditor;

AEditor := First;

repeat

  {do something with AEditor}

  AEditor := AEditor.NextEditor;

until AEditor = First;

See also: Attach, NextEditor, PrevEditor


TOvcEditor.FixedFont
FixedFont property

property TOvcEditor.FixedFont : TOvcFixedFont

Default: System (fpFixed)

FixedFont determines which font the editor uses.

FixedFont performs the same function as the standard Font property, except that it limits the displayed fonts (in the Name sub-property) to only fixed-pitch fonts. This is because the editor component supports only fixed-pitch fonts.


TOvcEditor.FlushUndoBuffer
FlushUndoBuffer method

procedure TOvcEditor.FlushUndoBuffer;

FlushUndoBuffer empties the editor's undo buffer.

This method is typically used only when your application is implementing a user-defined function that modifies the editor's text stream in such a way that the change cannot be undone (e.g., changing the case of all selected text).

See also: UndoBufferSize


TOvcEditor.GetCaretPosition
GetCaretPosition method

function TOvcEditor.GetCaretPosition(var Col : Integer) : LongInt;

GetCaretPosition returns the current position of the editing caret.

This method returns the current line number as the function result and the current column number in Col. The value returned in Col is an "actual" column number, not an "effective" column number. See EffectiveColumn for a discussion of column numbers.

See also: EffectiveColumn, SetCaretPosition


TOvcEditor.GetLine
GetLine method

function TOvcEditor.GetLine(LineNum : LongInt; Dest : PChar; DestLen : Integer) : PChar;

GetLine returns the text of the specified line.

GetLine returns the text of the line specified by LineNum. Dest is the buffer for the string, and DestLen is its size. The function result equals Dest. If word wrap is off, a single line can contain as many as 32,767 characters unless ParaLengthLimit or ByteLimit were used to limit the amount of text. If the line is longer than DestLen-1 characters, it is truncated.

See also: ByteLimit, GetPara, GetPrintableLine, ParaLengthLimit


TOvcEditor.GetMarkerPosition
GetMarkerPosition method

function TOvcEditor.GetMarkerPosition(N : Byte; var Col : Integer) : LongInt;

GetMarkerPosition obtains the position of the specified bookmark.

The function result is the paragraph number and Col is the position within the paragraph. N is the bookmark number (0 through 9). If the specified bookmark has not been set, GetMarkerPosition returns -1.

See also: SetMarker, SetMarkerAt


TOvcEditor.GetPara
GetPara method

function TOvcEditor.GetPara(ParaNum : LongInt; var Len : Word) : PChar;

GetPara returns a pointer to the specified paragraph.

This method returns a pointer to the text of the paragraph specified by ParaNum. If ParaNum is invalid (i.e., less than 1 or greater than ParaCount), GetPara returns a pointer to an empty string.

The pointer returned by GetPara should be considered a pointer to a read-only string. If you need to insert, delete, or replace text in the paragraph, you must use the appropriate combinations of the SetSelection, Clear, and Insert routines. The only exception is when you are making a modification that does not change the number of bytes in the paragraph or alter the line breaks if word wrap is on. The only obvious case that meets these rules is one in which you are changing the case of one or more characters in the string.

The following example demonstrates how to use this method by calculating the current position of the caret as a byte offset into the text stream. The '+2' accounts for the implicit carriage return and line feed at the end of each paragraph.

var

  L : LongInt;

  I, C : Integer;

  Bytes : LongInt;

  Len : Word;

begin

  L := OvcEditor1.GetCaretPosition(C);

  OvcEditor1.LineToPara(L, C);

  Bytes := Pred(C);  {bytes into current row}

  for I := 1 to L-1 do begin

    OvcEditor1,GetPara(I, Len);

    Inc(Bytes, Len + 2);

  end;

  Label1.Caption := Format('Bytes: %d', [Bytes]);

end;

See also: GetLine


TOvcEditor.GetPrintableLine
GetPrintableLine method

function TOvcEditor.GetPrintableLine(LineNum : LongInt; Dest : PChar; DestLen : Integer) : Integer;

GetPrintableLine returns a line suitable for printing.

This method returns the string at the line specified by LineNum in a format suitable for printing (i.e., with tabs expanded to spaces). Dest is the buffer for the string, and DestLen is its size. The function result indicates the length of the null-terminated string placed in Dest.

The following example shows how to use this method. S contains the text of line 1, with all tabs expanded, and SLen contains the length of the string.

var

  S    : array[0..1024] of Char;

  SLen : Integer;

...

  SLen := GetPrintableLine(1, S, SizeOf(S));

See also: GetLine, GetPara


TOvcEditor.GetSelection
GetSelection method

function TOvcEditor.GetSelection(var Line1 : LongInt; var Col1 : Integer; var Line2 : LongInt; var Col2 : Integer) : Boolean;

GetSelection returns True if any text is currently selected.

If the function result is True, the bounds of the selected region are the values returned in Line1, Col1, Line2, and Col2.

GetSelection is typically used in applications that provide menu items for selecting the various clipboard commands (e.g., Copy, Cut). If GetSelection returns False, these commands should be disabled.

See also: SetSelection


TOvcEditor.GetText
GetText method

function TOvcEditor.GetText(P : PChar; Size : Word) : Word;

GetText returns a copy of the editor's text stream.

This method returns the contents of the editor's text stream in P. Size is the size of the buffer pointed to by P, including the null terminator. If Size is smaller than the editor's text stream, P is truncated. The function result is the number of bytes copied into P. Each paragraph copied to P is terminated by a carriage return and line feed.

This method is typically used when the contents of the editor are guaranteed to always be less than 64KB.

See also: SetText


TOvcEditor.GotoMarker
GotoMarker method

procedure TOvcEditor.GotoMarker(N : Byte);

GotoMarker moves the caret to the specified bookmark.

This method moves the caret to the N'th bookmark, where N is a value in the range 0..9. If there is no N'th bookmark, GotoMarker does nothing.

See also: SetMarker, SetMarkerAt


TOvcEditor.HideSelection
HideSelection property

property TOvcEditor.HideSelection : Boolean

Default: True

HideSelection determines if highlighted text remains highlighted when the editor loses the focus.

If HideSelection is False, highlighted text remains highlighted even if the focus leaves the editor component. If HideSelection is True, highlighting is removed when the editor loses the focus and is restored when the editor regains the focus.


TOvcEditor.HighlightColors
HighlightColors property

property TOvcEditor.HighlightColors : TOvcColors

Default: clHighlightText and clHighlight

HighlightColors are the colors used to display the selected portion of the editor's text stream.

The following example shows how to change the editor's colors at run time so that highlighted text is displayed with blue text on a white background.

HighlightColors.TextColor := clBlue;

HighlightColors.BackColor := clWhite;


TOvcEditor.Insert
Insert method

procedure TOvcEditor.Insert(S : PChar);

Insert replaces the current selection with a text string.

This method replaces the currently selected text with the contents of S. If no text is currently selected, the text in S is inserted at the current position of the caret.

The following example demonstrates how to insert 'Hello World!' at the current caret position.

if GetSelection(L1, C1, L2, C2) then begin

  Line := GetCaretPosition(Col);

  SetSelection(Line, Col, Line, Col);

end;

Insert('Hello World!');

See also: GetCaretPosition, SetSelection


TOvcEditor.InsertMode
InsertMode property

property TOvcEditor.InsertMode : Boolean

Default: True

InsertMode turns insert mode on or off.

This property turns insert mode on or off within the editor. If insert mode is on, text is inserted into the editor, if off, entered text overwrites existing text at the current caret position.


TOvcEditor.LineCount
LineCount run-time read-only property

property TOvcEditor.LineCount : LongInt

LineCount returns the total number of lines in the editor.

If word wrap is off, the value returned by LineCount is the same as that returned by ParaCount.

See also: LineLength, Lines, ParaCount


TOvcEditor.LineLength
LineLength run-time read-only property

property TOvcEditor.LineLength[LineNum : LongInt] : Integer

LineLength returns the length of the specified line.

This indexed property returns the length of the line specified by LineNum. The valid range for LineNum is 1 to LineCount. If LineNum is invalid, -1 is returned.

The following example demonstrates how to use this property to get the length of the 5th line in the editor.

Len := LineLength[5];

See also: LineCount, Lines


TOvcEditor.LineToPara
LineToPara method

procedure TOvcEditor.LineToPara(var L : LongInt; var C : Integer);

LineToPara converts a line/column coordinate to a paragraph/position coordinate.

This method translates a line/column coordinate (L, C) into a paragraph/position coordinate (returned in L, C). If word wrap is off, the L and C parameters remain unchanged. The column/position value in C is a 1-based number.

LineToPara is most often used in cases where a line/column coordinate was obtained by calling GetCaretPosition or GetSelection, and you want to call GetPara to look at the text at that location.

See also: GetCaretPosition, GetPara, GetSelection, ParaToLine


TOvcEditor.Lines
Lines run-time read-only property

property TOvcEditor.Lines[LineNum : LongInt] : string

Lines returns the text of the specified line.

This indexed property returns the text of the line specified by LineNum as a Pascal-style string. If the length of the specified line is greater than 255, it is truncated to 255 characters.

The valid range for LineNum is 1 to LineCount. If you attempt to retrieve the text of a line outside the valid range, an empty string is returned.

See also: LineCount, LineLength


TOvcEditor.Margin
Margin property

property TOvcEditor.Margin : Integer

Default: 15

Margin determines the left and right margins in the editor window.

This property is used to set the width of the margin (in pixels). If no margin is desired, assign 0 to the Margin property. Note that bookmark bitmaps are not displayed if the margin is less than the width of the bitmaps (12 pixels).

See also: ShowBookmarks


TOvcEditor.Modified
Modified run-time property

property TOvcEditor.Modified : Boolean

Modified indicates whether the editor's text stream was modified since the editor last received the focus.

Assigning a value to this property turns the editor's modified flag on or off. Changing the state of the modified flag is primarily handled internally, but you can do so if you modify the text stream directly (see GetPara) or you need to clear the modified flag manually (it is done automatically when DeleteAll or TOvcTextFileEditor.SaveToFile is called).

See also: GetPara


TOvcEditor.NextEditor
NextEditor run-time read-only property

property TOvcEditor.NextEditor : TOvcCustomEditor

NextEditor returns a pointer to the next attached editor.

This method returns a pointer to the next editor component in the list of editors attached to the current editor. If there are no other editors attached to the current one, NextEditor returns a pointer to the current editor, and so do FirstEditor and PrevEditor, because the list of attached editors is a circular linked list.

See also: Attach, FirstEditor, PrevEditor


TOvcEditor.OnError
OnError event

property TOvcEditor.OnError : TEditorErrorEvent

TEditorErrorEvent = procedure(Sender : TObject; var ErrorCode : Word) of object;

OnError defines an event handler that is called when an editor error occurs.

If a method is assigned to this event, an exception is not raised when an error occurs. Instead, the assigned method is called, passing the error code as the ErrorCode parameter.

Sender is the object that generated the error. ErrorCode is one of the following error codes:

oeOutOfMemory - There is not sufficient memory to perform the requested operation.

oeRegionSize - The selected text exceeds 64KB and cannot be copied to the clipboard.

oeTooManyParas - The limit on the number of paragraphs was exceeded.

oeCannotJoin - The paragraphs cannot be joined. Typically this occurs when joining the two paragraphs would cause the new paragraph to exceed its size limit (32KB by default).

oeTooManyBytes - The limit on the total number of bytes was exceeded.

oeParaTooLong - The limit on the length of an individual paragraph was exceeded.

If no method is assigned to the OnError event, an EEditorError exception is raised when an error occurs. The exception dialog displays an abbreviated form of one of the error descriptions shown above.


TOvcEditor.OnShowStatus
OnShowStatus event

property TOvcEditor.OnShowStatus : TShowStatusEvent

TShowStatusEvent = procedure(Sender : TObject; ColNum : Integer; LineNum : LongInt) of object;

OnShowStatus defines an event handler that is called when the caret position changes.

Sender is the object that generated the event. ColNum is the new effective caret column position. LineNum is the new line number.


TOvcEditor.OnUserCommand
OnUserCommand event

property TOvcEditor.OnUserCommand : TUserCommandEvent

TUserCommandEvent = procedure(Sender : TObject; Command : Word) of object;

OnUserCommand defines an event handler that is called when a user-defined command is entered.

The method assigned to the OnUserCommand event is called when the key sequence corresponding to one of the user-defined commands (ccUser1, ccUser2, etc.) is entered.

For example, suppose you add the <CtrlF2> key sequence to the one of the active command tables and assign it to the ccUser1 command. When <CtrlF2> is pressed, the method assigned to the OnUserCommand event is called and ccUser1 is passed in Command. Sender is the object that intercepted the key sequence.

See the TOvcCommandProcessor class for additional information about user-defined commands and command tables.


TOvcEditor.ParaCount
ParaCount method

function TOvcEditor.ParaCount : LongInt

ParaCount returns the current number of paragraphs in the editor's text stream.

See also: LineCount


TOvcEditor.ParaLength
ParaLength run-time read-only property

property TOvcEditor.ParaLength[ParaNum : LongInt] : Integer

ParaLength returns the length of a paragraph.

This indexed property returns the length of the paragraph specified by ParaNum. The valid range for ParaNum is 1 to ParaCount. If ParaNum is outside the valid range, zero is returned for the length.

See also: GetPara, ParaCount


TOvcEditor.ParaLengthLimit
ParaLengthLimit property

property TOvcEditor.ParaLengthLimit : Integer

Default: MaxInt

ParaLengthLimit is the limit on the length of a paragraph.

Typically ParaLengthLimit is used only in cases where word wrap is always off and you want to limit the length of each line.

The following example turns word wrap off and sets the maximum length for each paragraph (line) to 127 characters.

WordWrap := False;

ParaLengthLimit := 127;

See also: ParaLimit


TOvcEditor.ParaLimit
ParaLimit property

property TOvcEditor.ParaLimit : LongInt

Default: MaxLongInt

ParaLimit is the limit on the total number of paragraphs.

Typically ParaLimit is used only in cases where word wrap is always off and you want to limit both the number of lines that can be entered and the length of the lines.

The following example turns word wrap off, limits the total number of paragraphs to 25, and limits each paragraph (line) to 127 characters.

WordWrap := False;

ParaLimit := 25;

ParaLengthLimit := 127;

See also: ParaLengthLimit


TOvcEditor.ParaPointer
ParaPointer run-time read-only property

property TOvcEditor.ParaPointer[ParaNum : LongInt] : PChar

ParaPointer returns a pointer to a paragraph.

This indexed property returns a pointer to the paragraph specified by ParaNum. The valid range for ParaNum is 1 to ParaCount. If ParaNum is outside the valid range, a pointer to a null string is returned.

The following example retrieves a copy of the 5th paragraph.

P := ParaPointer[5];

StrCopy(OurBuffer, P);

See also: GetPara


TOvcEditor.ParaToLine
ParaToLine method

procedure TOvcEditor.ParaToLine(var L : LongInt; var C : Integer);

ParaToLine converts a paragraph/position coordinate to a line/column coordinate.

This method converts a paragraph/position coordinate (L, C) into a line/column coordinate (returned in L, C). If word wrap is off, the L and C parameters remain unchanged. The column/position value in C is a 1-based number.

ParaToLine might be used, for example, to implement a specialized search routine (e.g., if you needed to allow searches based on regular expressions). This can be done by calling GetPara repeatedly until you find a match. Once the match is found, you can calculate the bounds of the text that you want to highlight in terms of the paragraph/position coordinates, call ParaToLine to translate the endpoints into the line/column coordinates, then call SetSelection to highlight the text (or use Insert to make replacements).

The following example moves the caret to column 1 of the next paragraph.

L := GetCaretPosition(C);

LineToPara(L, C);

Inc(L);

C := 1;

ParaToLine(L, C);

SetCaretPosition(L, C);

See also: GetCaretPosition, GetPara, LineToPara, SetCaretPosition


TOvcEditor.PasteFromClipboard
PasteFromClipboard method

procedure TOvcEditor.PasteFromClipboard;

PasteFromClipboard copies the contents of the Windows clipboard into the editor.

This method pastes the text from the clipboard into the editor, overwriting the current selection. PasteFromClipboard does nothing if the clipboard is empty or contains data other than text. To determine whether the clipboard contains any text that can be pasted, call Clipboard.HasFormat(CF_TEXT). If the result is True, the clipboard contains text that can be pasted.

See also: Clear, CopyToClipboard, CutToClipboard


TOvcEditor.PrevEditor
PrevEditor run-time read-only property

property TOvcEditor.PrevEditor : TOvcCustomEditor

PrevEditor returns a pointer to the previous attached editor.

This method returns a pointer to the previous editor component in the list of editors attached to the current editor. If there are no other editors attached to the current one, PrevEditor returns a pointer to the current editor, and so do FirstEditor and NextEditor, because the list of attached editors is a circular linked list.

See also: Attach, FirstEditor, NextEditor


TOvcEditor.ProcessCommand
ProcessCommand method

function TOvcEditor.ProcessCommand(Cmd, CharCode : Word) : Boolean;

ProcessCommand sends commands and characters to the editor.

This method allows sending commands and characters to the editor, just as if they were entered from the keyboard. Typical uses for this could include a simple macro playback facility.

If the editor processes the command, the function result is True; otherwise, it is False.

See the TOvcCommandProcessor  class for more information.

The following example demonstrates sending a series of commands to the editor while ignoring the function results.

ProcessCommand(ccChar, Ord('A'));

ProcessCommand(ccUp, 0);

ProcessCommand(ccChar, Ord('B'));


TOvcEditor.ReadOnly
ReadOnly property

property TOvcEditor.ReadOnly : Boolean

Default: False

ReadOnly determines if the editor's text stream can be edited.

If ReadOnly is True, the text cannot be modified. All insertion and deletion commands are ignored.


TOvcEditor.Redo
Redo method

procedure TOvcEditor.Redo;

Redo the last undone operation.

Redo has no effect if there is no undone operation to redo.

The following example redoes all undone operations.

while CanRedo do

  Redo;

See also: CanRedo, Undo


TOvcEditor.Replace
Replace method

function TOvcEditor.Replace(const S, R : string; Options : TSearchOptionSet) : LongInt;

TSearchOptionSet = set of TSearchOptions;

TSearchOptions = (soFind, soBackward, soMatchCase, soGlobal, soReplace, soReplaceAll, soWholeWord, soSelText);

Replace searches for a string and replaces it with another string.

This method replaces search string S with the replace string R. If S is found, the function result is a replacement count. If S is not found, the function result is -1.

The following can be specified in Options:

soReplace - A single replace operation is requested.

soReplaceAll - All matching text in a given range should be replaced.

soBackward - Search backward.

soMatchCase - Perform a case-sensitive search.

soWholeWord - A match should not occur if the search string is found embedded in another word. A word is delimited by a space, tab, or any of the following characters: ,./?;:`'"<>[]{}-=\+|()%@&^$#!~*.

soSelText - Search only in the currently selected text.

soGlobal - The search should start at the beginning or end of the file, depending on the state of the soBackward option, instead of at the current caret position.

The Options parameter is assumed to have either the soReplace or soReplaceAll option set (these options are mutually exclusive). It can also have any of the other options set.

If the soReplace option is set, a replacement is made only if the search string specified by S is currently selected. If it is not selected, Replace searches for the string. If it finds the string, it highlights the string and returns 0 (since the string was found, but no replacements were made). If it does not find the string, it returns -1. If the string is selected, it replaces the string with R, then searches for the next instance of the string, and selects it if it is found. Whether another instance of the string is found or not, 1 is returned because 1 replacement was made. A subsequent call to Replace with the same parameters repeats the search and returns a result of -1.

If the soReplaceAll option is set, the caret remains at its original position after all the occurrences of the string are replaced.

To better understand the search options and the use of the Replace function, study the source code for the TEXTEDIT sample project and experiment with a compiled version of it.

The following example replaces every instance of 'a' (as a word) with 'A'. Count is set to -1 if no instances are found, otherwise to the number of replacements that were made.

Count := Replace('a', 'A', [soReplaceAll, soMatchCase, soGlobal, soWholeWord);

See also: Search


TOvcEditor.ResetScrollBars
ResetScrollBars method

procedure TOvcEditor.ResetScrollBars(UpdateScreen : Boolean);

ResetScrollBars resets the horizontal and vertical scroll bars.

ResetScrollBars adjusts the ranges, updates the positions, and redraws the horizontal and vertical scroll bars for the editor component. If UpdateScreen is True, the editor window is updated immediately, otherwise it is updated when Windows is not busy with other tasks.

ResetScrollBars is intended primarily for internal use. In the rare cases where you might call it directly, it will typically be used in conjunction with DeleteAll and AppendPara.

See also: AppendPara, DeleteAll


TOvcEditor.ScrollBars
ScrollBars property

property TOvcEditor.ScrollBars : TScrollStyle

Default: ssBoth

ScrollBars determines whether vertical and horizontal scroll bars are displayed.

The TScrollStyle enumerated type is defined in the Delphi Controls unit. Both vertical and horizontal scroll bars are displayed by default.

See also: ScrollBarsAlways


TOvcEditor.ScrollBarsAlways
ScrollBarsAlways property

property TOvcEditor.ScrollBarsAlways : Boolean

Default: False

ScrollBarsAlways determines if the selected scroll bars are always displayed.

Setting ScrollBarsAlways to True forces the editor to display the selected scroll bars even if they are not currently needed. Otherwise, scroll bars are displayed only if part of the text stream is not visible in the current editor window.

See also: ScrollBars


TOvcEditor.ScrollPastEnd
ScrollPastEnd property

property TOvcEditor.ScrollPastEnd : Boolean

Default: False

ScrollPastEnd determines if the caret is allowed to move beyond the end of a line.

If ScrollPastEnd is True, the caret can move beyond the end of the current line. If it is False, pressing <Right> when the caret is at the end of the line moves the caret to the beginning of the next line. ScrollPastEnd is ignored if word wrap is on, because this behavior is always disabled.

See also: WordWrap


TOvcEditor.Search
Search method

function TOvcEditor.Search(const S : string; Options : TSearchOptionSet) : Boolean;

TSearchOptionSet = set of TSearchOptions;

TSearchOptions = (soFind, soBackward, soMatchCase, soGlobal, soReplace, soReplaceAll, soWholeWord, soSelText);

Search searches for a string.

If the search string S is found, Search selects the matched string and positions the caret to the right of the selected text, returning True as the function result.

The following can be specified in Options:

soFind - A single find operation is requested.

soBackward - Search backward.

soMatchCase - Perform a case-sensitive search.

soWholeWord - A match should not occur if the search string is found embedded in another word. A word is delimited by a space, tab, or any of the following characters: ,./?;:`'"<>[]{}-=\+|()%@&^$#!~*.

soSelText - Search only in the currently selected text.

soGlobal - The search should start at the beginning or end of the file, depending on the state of the soBackward option, instead of at the current caret position.

The Options parameter must have the soFind option set. It can also have any of the other options set.

See also: Replace


TOvcEditor.SelectAll
SelectAll method

procedure TOvcEditor.SelectAll(CaretAtEnd : Boolean);

SelectAll highlights all text in the editor's text stream.

If CaretAtEnd is True, the caret is placed at the end of the selected text. If CaretAtEnd is False, the caret is placed at the start of the selected text.

See also: SetSelection


TOvcEditor.SetCaretPosition
SetCaretPosition method

procedure TOvcEditor.SetCaretPosition(Line : LongInt; Col : Integer);

SetCaretPosition moves the caret to the specified line and column.

Col is an actual column number, not an effective column number. See EffectiveColumn for a discussion of column numbers.

The following example moves the caret to column 1 of the last line.

SetCaretPosition(LineCount, 1);

See also: EffectiveColumn, GetCaretPosition


TOvcEditor.SetMarker
SetMarker method

procedure TOvcEditor.SetMarker(N : Byte);

SetMarker sets a bookmark at the current caret position.

This method sets bookmark N to point to the current position of the caret.

The following example demonstrates setting bookmark 1 to point to the current position of the caret.

SetMarker(1);

See also: GotoMarker, SetMarkerAt


TOvcEditor.SetMarkerAt
SetMarkerAt method

procedure TOvcEditor.SetMarkerAt(N : Byte; Line : LongInt; Col : Integer);

SetMarkerAt sets a bookmark at the specified position.

This method sets bookmark N to point to the specified line and column. Col is assumed to be an actual column number, not an effective column number. See EffectiveColumn for a discussion of column numbers.

The following example demonstrates setting bookmark 1 to point to the first character of the last line in the editor.

SetMarkerAt(1, LineCount, 1);

See also: GotoMarker, SetMarker


TOvcEditor.SetSelection
SetSelection method

procedure TOvcEditor.SetSelection(Line1 : LongInt; Col1 : Integer; Line2 : LongInt; Col2 : Integer; CursorAtEnd : Boolean);

SetSelection selects a region of text.

After the call to SetSelection, the region from (Line1,Col1) to (Line2,Col2) is selected. The caret is positioned at (Line2,Col2) if CursorAtEnd is True, or at (Line1,Col1) if it is False.

The following example selects all text in the editor and places the caret at (1,1).

SetSelection(1, 1, LineCount, LineLength(LineCount), False);

See also: GetSelection, LineLength


TOvcEditor.SetText
SetText method

procedure TOvcEditor.SetText(P : PChar);

SetText replaces the current editor's contents.

SetText sets the contents of the editor's text stream to the contents of the buffer pointed to by P. This is accomplished by calling DeleteAll, Insert, and ResetScrollBars.

If P contains multiple paragraphs, separate each with a carriage return and line feed.

See also: GetText


TOvcEditor.ShowBookmarks
ShowBookmarks property

property TOvcEditor.ShowBookmarks : Boolean

Default: True

ShowBookmarks determines if the bookmark icons are displayed.

If ShowBookmarks is True and there is sufficient room in the editor window margin, the bookmark icons are displayed. All "marker" functions operate regardless of the ShowBookmarks setting.

See also: GotoMarker, Margin, SetMarker, SetMarkerAt


TOvcEditor.TabSize
TabSize property

property TOvcEditor.TabSize : Byte

Default: 8

TabSize determines the distance between tab stops.

The following example sets the tab size to 5 character positions.

TabSize := 5;

See also: TabType, WantTab


TOvcEditor.TabType
TabType property

property TOvcEditor.TabType : TTabType

TTabType = (ttReal, ttFixed, ttSmart);

Default: ttReal

TabType determines the type of tab used by the editor.

This property selects the type of behavior that is desired when the <Tab> key is pressed. Possible values are ttReal, ttFixed, and ttSmart.

See also: TabSize, WantTab


TOvcEditor.TextLength
TextLength run-time read-only property

property TOvcEditor.TextLength : LongInt

TextLength returns the length of text in the editor.

This property returns the current length of text in the editor's text stream. This value is the same as the total number of bytes in the editor's text stream. The editor does not store CR/LF characters, so this value will be less than the length of a file containing the same text.

See also: ByteLimit


TOvcEditor.TopLine
TopLine run-time property

property TOvcEditor.TopLine : LongInt

TopLine determines the line at the top of the editor window.

Assigning a value between 1 and the number of lines in the editor causes the editor to scroll the requested line to the top of the editor.


TOvcEditor.Undo
Undo method

procedure TOvcEditor.Undo;

Undo undoes the last editing operation.

To determine whether there is anything to be undone, call CanUndo. To "undo an undo," call Redo.

The following example undoes all operations that can be undone.

while CanUndo do

  Undo;

See also: CanUndo, Redo, UndoBufferSize


TOvcEditor.UndoBufferSize
UndoBufferSize property

property TOvcEditor.UndoBufferSize : Word

Default: 8K

UndoBufferSize is the size of the undo buffer.

The default size of the undo buffer is 8KB, which is more than adequate for most applications. Smaller buffers might be appropriate when the editor component is inside an entry form. Larger buffers are probably desirable in dedicated text editing applications.

Caution: Changing the buffer size destroys the contents of the existing buffer, even if the new buffer is larger than the old buffer.

Except when you want to disable the undo facility altogether (by assigning 0 to UndoBufferSize), it is not advisable to specify a buffer size less than 1KB. It is not really possible to configure the editor component to allow only a single operation to be undone. Any editing operation might create a single undo record containing as few as 16 bytes, or it might create a series of related records occupying hundreds or even thousands of bytes.

The following example disables the undo facility.

UndoBufferSize := 0;


TOvcEditor.VisibleColumns
VisibleColumns run-time read-only property

property TOvcEditor.VisibleColumns : Integer

VisibleColumns returns the number of columns in the editor window.

See also: WrapColumn


TOvcEditor.WantEnter
WantEnter property

property TOvcEditor.WantEnter : Boolean

Default: True

WantEnter determines whether the editor processes the <Enter> key.

If WantEnter is True, the editor processes the <Enter> key and creates a new paragraph. If WantEnter is False, you can still insert new paragraphs by pressing <CtrlEnter> and the <Enter> key is passed on to the parent form.

See also: WantTab


TOvcEditor.WantTab
WantTab property

property TOvcEditor.WantTab : Boolean

Default: False

WantTab determines whether the editor inserts tab characters when <Tab> is pressed.

If WantTab is True and the <Tab> key is pressed, depending on the setting of the TabType, either spaces or a tab character are inserted. If WantTab is False, <CtrlTab> is used instead of <Tab> to insert tabs into the text stream.

See also: TabType, WantEnter


TOvcEditor.WordWrap
WordWrap property

property TOvcEditor.WordWrap : Boolean

Default: False

WordWrap turns word wrap on or off.

Caution: A potentially time-consuming process of recalculation occurs every time you turn word wrap on or off, and every time you change the wrap column while word wrap is already on. Therefore, if word wrap is currently off, and you want to "simultaneously" turn word wrap on and set the wrap column, you should set WrapColumn first, then set WordWrap to True. If you set WordWrap to True first, the calculations are done twice.

The following example turns on word wrap.

WordWrap := True;

See also: WrapAtLeft, WrapColumn


TOvcEditor.WrapAtLeft
WrapAtLeft property

property TOvcEditor.WrapAtLeft : Boolean

Default: True

WrapAtLeft determines the caret placement when <Left> is pressed while in column 1 of the editor.

If WrapAtLeft is True, the editing caret is moved to the end of the previous line if <Left> is pressed when the caret is in column 1. WrapAtLeft is ignored if word wrap is on, because this behavior is always enabled.

See also: WordWrap


TOvcEditor.WrapColumn
WrapColumn property

property TOvcEditor.WrapColumn : Integer

Default: 80

WrapColumn is the column for word wrap.

Changing WrapColumn has no immediate effect if WordWrap is False.

If you want to emulate the behavior of the standard Windows edit control (which bases the wrap column on the current dimensions of the editor's window), set WrapColumn to some value less than or equal to the number of visible columns. See the TEXTEDIT demo program for an example of how to implement this.

Caution: A potentially time-consuming process of recalculation occurs every time you turn word wrap on or off, and every time you change the wrap column while word wrap is already on. Therefore, if word wrap is currently off, and you want to simultaneously turn word wrap on and set the wrap column, you should set WrapColumn first, then set WordWrap to True. If you set WordWrap to True first, the calculations are done twice.

The following example sets the editor's word wrap column to one less than the number of visible columns. An ideal place to do this is in the form's OnResize event handler.

WrapColumn := VisibleColumns-1;


TOvcEditor.events
TOvcEditor events

OnClick	OnKeyDown

OnDblClick	OnKeyPress

OnDragDrop	OnKeyUp

OnDragOver	OnMouseDown

OnEndDrag	OnMouseMove

OnEnter	OnMouseUp

OnError	OnShowStatus

OnExit	OnUserCommand


TOvcEditor.methods
TOvcEditor methods

AlignControls 	HandleNeeded

AppendPara	HasParent

Assign	Hide

AssignTo 	InheritsFrom

Attach	InitInstance

BeginDrag	Insert

BringToFront	InsertComponent

Broadcast	InsertControl

CanFocus	InstanceSize

CanRedo	Invalidate

CanUndo	IsControlMouseMsg

ChangeName 	KeyDown

ChangeScale 	KeyPress

ClassInfo	KeyUp

ClassName	LineToPara

ClassParent	Loaded

ClassType	MainWndProc

Clear	MethodAddress

ClearMarker	MethodName

Click 	MouseDown

ClientToScreen	MouseMove

ContainsControl	MouseUp

ControlAtPos	NewInstance

CopyToClipboard	NotifyControls

Create	PaintControls

CreateHandle 	PaintHandler

CreateSubClass 	PaintWindow

CreateWindowHandle 	PaletteChanged

CutToClipboard	ParaCount

DblClick 	ParaToLine

DefaultHandler 	PasteFromClipboard

DefineProperties 	Perform

DeleteAll	ProcessCommand

Destroy	ReadState

DestroyComponents	Realign

DestroyHandle 	RecreateWnd

Destroying	Redo

DestroyWindowHandle 	Refresh

DestroyWnd 	RemoveComponent

DisableAlign	RemoveControl

Dispatch	Repaint

DoEnter 	Replace

DoExit 	ResetScrollBars

DoKeyDown 	ScaleBy

DoKeyPress 	ScaleControls

DoKeyUp 	ScreenToClient

DragCanceled 	ScrollBy

Dragging	Search

EffectiveColumn	SelectAll

EnableAlign	SelectFirst

EndDrag	SelectNext

FieldAddress	SendToBack

FindComponent	SetBounds

FindNextControl 	SetCaretPosition

FlushUndoBuffer	SetDesigning

Focused	SetFocus

Free	SetMarker

FreeInstance	SetMarkerAt

GetCaretPosition	SetName

GetClientOrigin 	SetParent

GetClientRect 	SetSelection

GetDeviceContext 	SetText

GetLine	SetTextBuf

GetMarkerPosition	SetZOrder

GetPalette 	Show

GetPara	ShowControl

GetPrintableLine	Undo

GetSelection	Update

GetTabOrderList	UpdateBoundsRect

GetText	ValidateRename

GetTextBuf	VisibleChanging

GetTextLen	WndProc

GotoMarker	WriteComponents

HandleAllocated	WriteState


TOvcEditor.properties
TOvcEditor properties

Align	Lines

AutoIndent	Margin

BorderStyle	Modified

BoundsRect 	MouseCapture

Brush 	Name

ByteLimit	NextEditor

Canvas  	Owner

Caption  	ParaLength

CaretIns	ParaLengthLimit

CaretOvr	ParaLimit

ClientHeight 	ParaPointer

ClientOrigin 	Parent

ClientRect 	ParentColor

ClientWidth 	ParentCtl3D

Color	ParentFont

ComponentCount 	ParentShowHint

ComponentIndex 	PopupMenu

Components 	PrevEditor

ComponentState 	ReadOnly

ControlCount 	ScrollBars

Controller	ScrollBarsAlways

Controls 	ScrollPastEnd

ControlState 	ShowBookmarks

ControlStyle 	ShowHint

Ctl3D	Showing

Cursor	TabOrder

DefWndProc  	TabSize

DesignInfo 	TabStop

DragCursor	TabType

DragMode	Tag

Enabled	Text

FirstEditor 	TextLength

FixedFont	Top

Font  	TopLine

Handle 	UndoBufferSize

Height	Visible

HelpContext	VisibleColumns

HideSelection	WantEnter

HighlightColors	WantTab

Hint	Width

InsertMode	WindowHandle

IsControl  	WordWrap

Left	WrapAtLeft

LineCount 	WrapColumn

LineLength


TOvcFileViewer
 TOvcFileViewer component

See also: properties, events, methods, hierarchy

Component Overview

If you want to use a viewer component to implement a browser for displaying files of any kind (binary as well as text), use the TOvcFileViewer component.

Besides being able to display the contents of binary files, TOvcFileViewer has one other important advantage over its sibling: it does not try to read the entire file into memory. Instead, TOvcFileViewer reads files in 4KB segments, storing the data in a series of buffers, which are managed on a least-recently-used basis (i.e., when all of its buffers are full, it reuses the buffer that was least recently used). The main disadvantage of TOvcFileViewer is its performance. Although it is designed to respond as quickly as possible, there are cases where its response time is noticeably slow, such as when it is asked to move the cursor from the beginning of a long file to the end. In such cases, the TOvcFileViewer displays an hourglass cursor to warn the user of the possible delay.

The TOvcFileViewer is essentially identical to the TOvcTextFileViewer, except that there are a few more properties. BufferPageCount determines the number of buffers that should be allocated to store the data read from disk. In general, the larger the value specified here, the better the TOvcFileViewer will perform. The minimum value for BufferPageCount is 2, and the maximum value is 512. If the value that you specify is outside this range, the default value of 16 is assumed. Since each buffer holds 4KB of data, 16 buffers will hold 64KB of data.

The InHexMode property indicates whether you want the browser to display the data in hex mode.

Generally, you should assign True to the InHexMode property only in cases where you know for certain that a binary file is being displayed, or where the stated purpose of your viewer window is to display the contents of binary files. In all other cases, you should provide the user a means of switching between ASCII and hex modes.

For a comprehensive example of how to use a TOvcFileViewer, see the FILEVIEW demo program.


TOvcFileViewer hierarchy


TOvcFileViewer.BufferPageCount
BufferPageCount property

property TOvcFileViewer.BufferPageCount : Integer

Default: 16

BufferPageCount is the number of buffers for the viewer.

BufferPageCount determines number of buffers that should be allocated to store the data read from disk. In general, the larger the value specified here, the better the TOvcFileViewer will perform. The minimum value for BufferPageCount is 2, and the maximum value is 512. If the value that you specify is outside this range, the default value of 16 is assumed. Since each buffer holds 4KB of data, 16 buffers will hold 64KB of data.

BufferPageCount can be changed while a file is open. The buffers are reallocated and existing buffer contents are transferred automatically.


TOvcFileViewer.FileName
FileName property

property TOvcFileViewer.FileName : string

FileName is the name of the file to view.

FileName is the file in the viewer or the name of a file that will be loaded from disk. If IsOpen is True and you change FileName, the new file is automatically loaded.

The following example loads a file into the text file viewer.

OvcTextFileViewer1.FileName := 'C:\AUTOEXEC.BAT';

OvcTextFileViewer1.IsOpen := True;

See also: IsOpen


TOvcFileViewer.FileSize
FileSize run-time read-only property

property TOvcFileViewer.FileSize : LongInt

FileSize is the number of bytes in the open file.

If the file is closed, FileSize returns 0.

The following example opens a file and obtains the size of the file.

OvcTextFileViewer1.FileName := 'C:\AUTOEXEC.BAT';

OvcTextFileViewer1.IsOpen := True;

Size := OvcTextFileViewer1.FileSize;


TOvcFileViewer.FilterChars
FilterChars property

property TOvcFileViewer.FilterChars : Boolean

Default: True

FilterChars determines if the viewer displays non-ASCII characters.

If the InHexMode property is True and FilterChars is True, the viewer displays characters outside of the range (#32..#127) as a period. If InHexMode is True and FilterChars is False, the viewer displays all characters--their appearance depends on the current font.

If InHexMode is False, this property has no effect.

See also: InHexMode


TOvcFileViewer.InHexMode
InHexMode property

property TOvcFileViewer.InHexMode : Boolean

Default: False

InHexMode determines whether the viewer is in hex or ASCII mode.

If InHexMode is True, the viewer is in hex mode. If it is False, the viewer is in ASCII mode.


TOvcFileViewer.IsOpen
IsOpen property

property TOvcFileViewer.IsOpen : Boolean

Default: False

IsOpen determines whether the file is open.

The IsOpen property determines if the file specified by the FileName property is open (i.e., being viewed). Setting IsOpen to True causes the file specified by the FileName property to be opened. Setting IsOpen to False removes any existing text in the viewer, deallocates the buffers, and resets the scroll bars.

The file is opened as read-only ($20) and any file errors generate standard Delphi exceptions.

See also: FileName


TOvcFileViewer.events
TOvcFileViewer events

OnClick	OnKeyPress

OnDblClick	OnKeyUp

OnDragDrop	OnMouseDown

OnDragOver	OnMouseMove

OnEndDrag	OnMouseUp

OnEnter	OnShowStatus

OnExit	OnUserCommand

OnKeyDown


TOvcFileViewer.methods
TOvcFileViewer methods

ActualColumn	HandleAllocated

AlignControls 	HandleNeeded

Assign	HasParent

AssignTo 	Hide

BeginDrag	InheritsFrom

BringToFront	InitInstance

Broadcast	InsertComponent

CanFocus	InsertControl

ChangeName 	InstanceSize

ChangeScale 	Invalidate

ClassInfo	IsControlMouseMsg

ClassName	KeyDown

ClassParent	KeyPress

ClassType	KeyUp

ClearMarker	Loaded

Click 	MainWndProc

ClientToScreen	MethodAddress

ContainsControl	MethodName

ControlAtPos	MouseDown

CopyToClipboard	MouseMove

Create	MouseUp

CreateHandle 	NewInstance

CreateSubClass 	NotifyControls

CreateWindowHandle 	PaintControls

DblClick 	PaintHandler

DefaultHandler 	PaintWindow

DefineProperties 	PaletteChanged

Destroy	Perform

DestroyComponents	ReadState

DestroyHandle 	Realign

Destroying	RecreateWnd

DestroyWindowHandle 	Refresh

DestroyWnd 	RemoveComponent

DisableAlign	RemoveControl

Dispatch	Repaint

DoEnter 	ScaleBy

DoExit 	ScaleControls

DoKeyDown 	ScreenToClient

DoKeyPress 	ScrollBy

DoKeyUp 	Search

DragCanceled 	SelectAll

Dragging	SelectFirst

EffectiveColumn	SelectNext

EnableAlign	SendToBack

EndDrag	SetCaretPosition

FieldAddress	SetDesigning

FindComponent	SetFocus

FindNextControl 	SetMarker

Focused	SetMarkerAt

Free	SetName

FreeInstance	SetParent

GetCaretPosition	SetSelection

GetClientOrigin 	SetTextBuf

GetClientRect 	SetZOrder

GetDeviceContext 	Show

GetLine	ShowControl

GetMarkerPosition	Update

GetPalette 	UpdateBoundsRect

GetPrintableLine	ValidateRename

GetSelection	VisibleChanging

GetTabOrderList	WndProc

GetTextBuf	WriteComponents

GetTextLen	WriteState

GotoMarker


TOvcFileViewer.properties
TOvcFileViewer properties

Align	Handle

BorderStyle	Height

BoundsRect 	HelpContext

Brush 	HighlightColors

BufferPageCount	Hint

Canvas  	InHexMode

Caption  	IsControl

Caret	IsOpen

CaretActualPos 	Left

CaretEffectivePos 	LineCount

ClientHeight 	LineLength

ClientOrigin 	Lines

ClientRect 	MarginColor

ClientWidth 	MouseCapture

Color	Name

ComponentCount 	Owner

ComponentIndex 	Parent

Components 	ParentColor

ComponentState 	ParentCtl3D

ControlCount 	ParentFont

Controller	ParentShowHint

Controls 	PopupMenu

ControlState 	ScrollBars

ControlStyle 	ShowBookmarks

Ctl3D	ShowHint

Cursor	Showing

DefWndProc  	TabOrder

DesignInfo 	TabSize

DragCursor	TabStop

DragMode	Tag

Enabled 	Text

ExpandTabs	Top

FileName	TopLine

FileSize 	Visible

FilterChars	Width

FixedFont	WindowHandle

Font


TOvcFixedFont
TOvcFixedFont class

The TOvcFixedFont class is very similar to the standard Delphi TFont class. The only difference is that the Name property which lists the available font names is limited to displaying names of fixed-pitch fonts only. Several Orpheus components require a fixed-pitch font and the TOvcFixedFont class allows them to present only the fonts that are valid.

The TOvcFixedFont class provides Color, Font, Name, Size, and Style properties, but omits the Pitch property. With the exception of the Name and Font properties, their behavior is identical to the TFont properties of the same names.

The Font property provides access to the TOvcFixedFont's internal TFont object as a read-only property. This might be required if you need to assign the font to another component or class. One such situation occurs when you print the text contained in an Orpheus editor component. You could do something like this to assign the font that the editor is currently using to a printer object.

Printer.Canvas.Font := Editor1.FixedFont.Font;

To assign a valid TFont (a fixed-pitch font) or another TOvcFixedFont object to an instance of TOvcFixedFont at run time, assign the font object to the TOvcFixedFont object using the Assign method.

var

  MyFont      : TFont;

  MyFixedFont : TOvcFixedFont;

...

Editor1.FixedFont.Assign(MyFont);

... {or}

Editor1.FixedFont.Assign(MyFixedFont);

Attempting to assign a font that is not a fixed pitch font to a TOvcFixedFont object raises an EInvalidFixedFont exception. Attempting to assign something other than a TFont or TOvcFixedFont using the Assign method raises a EInvalidFontParam exception.


TOvcFourWaySpinner
 TOvcFourWaySpinner component

See also: properties, events, methods, hierarchy

Component Overview

The TOvcFourWaySpinner is very similar to the TOvcSpinner, except that it adds left and right spin buttons to the up and down spin buttons. Its spin buttons look just like the component icon on the component pallette.

Several of the example programs use TOvcFourWaySpinner components with date fields. The left and right spin buttons move the caret among the day, month, and year subfields and the up and down spin buttons increase and decrease the current subfield.

To use a spin component, you provide an OnClick event handler that responds to the user clicking on the spin buttons. However, if a TOvcFourWaySpinner has its FocusedControl property set to one of the Orpheus entry field components, you do not need to write an event handler. The spin component is "aware" of Orpheus entry fields and directly calls the necessary methods to increase and decrease field values for entry fields editing any of the numeric, date, or time data types.


TOvcFourWaySpinner hierarchy


TOvcFourWaySpinner.ForceSquare
ForceSquare property

property TOvcFourWaySpinner.ForceSquare : Boolean

Default: False

ForceSquare determines whether the height and width of the spin component are forced to be equal.

If ForceSquare is True, adjustments to the size of the spin component are monitored and possibly modified to ensure that the height and width are equal. If adjustments are needed, the smaller of the height or width is used.


TOvcFourWaySpinner.events
TOvcFourWaySpinner events

OnClick	OnKeyDown

OnDblClick 	OnKeyPress

OnDragDrop 	OnKeyUp

OnDragOver 	OnMouseDown

OnEndDrag 	OnMouseMove

OnEnter 	OnMouseUp

OnExit


TOvcFourWaySpinner.methods
TOvcFourWaySpinner methods

AlignControls 	HasParent

Assign	Hide

AssignTo 	InheritsFrom

BeginDrag	InitInstance

BringToFront	InsertComponent

Broadcast	InsertControl

CanFocus	InstanceSize

ChangeName 	Invalidate

ChangeScale 	IsControlMouseMsg

ClassInfo	KeyDown

ClassName	KeyPress

ClassParent	KeyUp

ClassType	Loaded

Click 	MainWndProc

ClientToScreen	MethodAddress

ContainsControl	MethodName

ControlAtPos	MouseDown

Create	MouseMove

CreateHandle 	MouseUp

CreateSubClass 	NewInstance

CreateWindowHandle 	NotifyControls

DblClick 	PaintControls

DefaultHandler 	PaintHandler

DefineProperties 	PaintWindow

Destroy	PaletteChanged

DestroyComponents	Perform

DestroyHandle 	ReadState

Destroying	Realign

DestroyWindowHandle 	RecreateWnd

DestroyWnd 	Refresh

DisableAlign	RemoveComponent

Dispatch	RemoveControl

DoEnter 	Repaint

DoExit 	ScaleBy

DoKeyDown 	ScaleControls

DoKeyPress 	ScreenToClient

DoKeyUp 	ScrollBy

DragCanceled 	SelectFirst

Dragging	SelectNext

EnableAlign	SendToBack

EndDrag	SetDesigning

FieldAddress	SetFocus

FindComponent	SetName

FindNextControl 	SetParent

Focused	SetTextBuf

Free	SetZOrder

FreeInstance	Show

GetClientOrigin 	ShowControl

GetClientRect 	Update

GetDeviceContext 	UpdateBoundsRect

GetPalette 	ValidateRename

GetTabOrderList	VisibleChanging

GetTextBuf	WndProc

GetTextLen	WriteComponents

HandleAllocated	WriteState

HandleNeeded


TOvcFourWaySpinner.properties
TOvcFourWaySpinner properties

Acceleration	Font

Align 	ForceOddSize

AutoRepeat	ForceSquare

BoundsRect 	Handle

Brush 	Height

Canvas  	HelpContext

Caption  	Hint

ClientHeight 	IsControl

ClientOrigin 	Left

ClientRect 	MouseCapture

ClientWidth 	Name

Color  	Owner

ComponentCount 	Parent

ComponentIndex 	ParentColor

Components 	ParentCtl3D

ComponentState 	ParentFont

ControlCount 	ParentShowHint

Controller 	PopupMenu

Controls 	ShowHint

ControlState 	Showing

ControlStyle 	TabOrder

Ctl3D  	TabStop

Cursor	Tag

DefWndProc  	Text

Delta	Top

DesignInfo 	Visible

DragCursor  	Width

DragMode  	WindowHandle

Enabled	WrapMode

FocusedControl


TOvcGridPen
TOvcGridPen class

See also: properties, methods, hierarchy

Class Overview

The TOvcGridPen class encapsulates the pen attributes for drawing a grid on the table. A grid is the set of horizontal and vertical lines that separate the cells. The table has five possible grid styles or effects: none, vertical lines only, horizontal lines only, vertical and horizontal lines, and a 3D grid.

The table uses four different grid pens: one for normal cells, one for locked cells, one for the focus box around the active cell when the table has the focus, and one for the focus box around the active cell when the table does not have the focus. These four grid pens are encapsulated in the TOvcGridPenSet class. The table creates and publishes an object of TOvcGridPenSet class.


TOvcGridPen hierarchy


TOvcGridPen.Effect
Effect property

property TOvcGridPen.Effect : TGridEffect

TGridEffect = (geNone, geVertical, geHorizontal, geBoth, ge3D);

Default: geBoth

Effect defines the style of grid.

The styles of grid are:

geNone - No grid is drawn.

geVertical - Vertical lines are drawn in NormalColor.

geHorizontal - Horizontal lines are drawn in NormalColor.

geBoth - Both vertical and horizontal lines are drawn in NormalColor.

ge3D - A 3D-style grid with the top and left hand lines drawn in SecondColor and the bottom and right lines in NormalColor. If SecondColor is clWhite and NormalColor is clBlack, the cells appear raised. If SecondColor is clBlack and NormalColor is clWhite, the cells appear lowered.

The grid lines are drawn with a pen width of 1.

See also: NormalColor, SecondColor


TOvcGridPen.NormalColor
NormalColor property

property TOvcGridPen.NormalColor : TColor

Default: clBtnShadow

NormalColor is the normal color of the grid pen.

NormalColor is used to draw the grid lines when the Effect property is geVertical, geHorizontal, or geBoth. When Effect is ge3D, NormalColor is used to draw the bottom and right lines.

See also: Effect, SecondColor


TOvcGridPen.SecondColor
SecondColor property

property TOvcGridPen.SecondColor : TColor

Default: clBtnHighlight

SecondColor is the secondary color of the grid pen.

SecondColor is used to draw the top and left grid lines when the Effect property is ge3D. Otherwise, SecondColor is not used.

See also: Effect, NormalColor


TOvcGridPen.Style
Style property

property TOvcGridPen.Style : TPenStyle

Default: psSolid

Style defines the style of the pen used when drawing grid lines.

See the TPenStyle type in the Delphi documentation for a list of the pen styles. If the pen style is a dotted or dashed type, the background color of the pen is set to the same color as the Color property of the TOvcTable component.

The grid lines are drawn with a pen width of 1.

See also: Effect


TOvcGridPen.methods
TOvcGridPen methods

Assign	Dispatch

AssignTo 	FieldAddress

ClassInfo	Free

ClassName	FreeInstance

ClassParent	InheritsFrom

ClassType	InitInstance

Create	InstanceSize

DefaultHandler	MethodAddress

DefineProperties 	MethodName

Destroy	NewInstance


TOvcGridPen.properties
TOvcGridPen properties

Effect	SecondColor

NormalColor	Style


TOvcGridPenSet
TOvcGridPenSet class

See also: properties, methods, hierarchy

Class Overview

An Orpheus table requires four distinct grid pens and these are encapsulated into a TOvcGridPenSet. The four types are the grid lines around locked cells, the grid lines around the active cell when the table has the focus, the grid lines around the active cell when the table does not have the focus, and the grid lines in the main body of the table. The TOvcTable class creates an object of this type and publishes it as the GridPenSet property.


TOvcGridPenSet hierarchy


TOvcGridPenSet.CellWhenFocused
CellWhenFocused property

property TOvcGridPenSet.CellWhenFocused : TOvcGridPen

Default: solid, black, both lines (horizontal and vertical)

CellWhenFocused is the grid pen used for the active cell when the table has the focus.

This grid pen is used to draw a box around the active cell when the table has the focus. The box is drawn inside the normal grid.


TOvcGridPenSet.CellWhenUnfocused
CellWhenUnfocused property

property TOvcGridPenSet.CellWhenUnfocused : TOvcGridPen

Default: dashed, black, both lines (horizontal and vertical)

CellWhenUnfocused is the grid pen used for the active cell when the table does not have the focus.

This grid pen is used to draw a box around the active cell when the table does not have the focus. The box is drawn inside the normal grid.


TOvcGridPenSet.LockedGrid
LockedGrid property

property TOvcGridPenSet.LockedGrid : TOvcGridPen

Default: solid, button shadow and highlight colors, raised 3D effect

LockedGrid is the grid pen used for the locked cells in the table.


TOvcGridPenSet.NormalGrid
NormalGrid property

property TOvcGridPenSet.NormalGrid : TOvcGridPen

Default: dotted, button shadow color, both lines (horizontal and vertical)

NormalGrid is the grid pen used for the normal part of the table.


TOvcGridPenSet.methods
TOvcGridPenSet methods

Assign	Dispatch

AssignTo 	FieldAddress

ClassInfo	Free

ClassName	FreeInstance

ClassParent	InheritsFrom

ClassType	InitInstance

Create	InstanceSize

DefaultHandler	MethodAddress

DefineProperties 	MethodName

Destroy	NewInstance


TOvcGridPenSet.properties
TOvcGridPenSet properties

CellWhenFocused	LockedGrid

CellWhenUnfocused	NormalGrid


TOvcIntlSup
TOvcIntlSup class

See also: properties, events, methods, hierarchy

Class Overview

The TOvcIntlSup class serves as a link between the settings contained in the WIN.INI file and components whose behavior depends on the Windows international settings. This class and its companion unit, OvcDT, provide a full suite of date and time handling routines. OvcDt is described in Date and Time Routines.

When an instance of the TOvcIntlSup class is created, it scans the Windows WIN.INI file for international settings. These settings are stored in the instance of TOvcIntlSup and are used during formatting operations and to create picture masks that are used by several Orpheus components.

A global instance of the TOvcIntlSup class (named OvcIntlSup) is created automatically and used as the default OvcIntlSupport property value for several Orpheus components.

Caution: Directly modifying OvcIntlSup will effect all components that use it. Therefore, be careful when changing OvcIntlSup's default property values.


TOvcIntlSup hierarchy


TOvcIntlSup.AutoUpdate
AutoUpdate property

property TOvcIntlSup.AutoUpdate : Boolean

Default: False

AutoUpdate determines if changes in WIN.INI are detected.

If AutoUpdate is True, changes made in the Windows WIN.INI file while an application is running are detected and used to reset the values of the TOvcIntlSup properties automatically.

When AutoUpdate is True, a window handle is created so that an internal window procedure can respond to WM_WININICHANGE messages. Setting AutoUpdate to False destroys the internal window handle and disables WM_WININICHANGE handling.

When an instance of TOvcIntlSup is created, all of its properties are initialized to match the current international settings in the WIN.INI file. Therefore, it is not necessary to set this property to True unless you want changes to WIN.INI to be reflected in your application at run time.


TOvcIntlSup.CommaChar
CommaChar property

property TOvcIntlSup.CommaChar : Char

Default: ','

CommaChar is the character used to separate digits in groups of a thousand.

CommaChar is initialized to the value in the sThousands entry in the Windows WIN.INI file.

See also: DecimalChar


TOvcIntlSup.CurrencyDigits
CurrencyDigits property

property TOvcIntlSup.CurrencyDigits : Byte

Default: 2

CurrencyDigits is the number of decimal places to use when formatting currency values.

CurrencyDigits is initialized to the value in the iCurrDigits entry in the Windows WIN.INI file.


TOvcIntlSup.CurrencyLtStr
CurrencyLtStr property

property TOvcIntlSup.CurrencyLtStr : TCurrencySt

TCurrencySt = array[0..5] of Char;

Default: '$'

CurrencyLtStr holds the character(s) placed to the left of a currency value.

Normally, this is a single character, but it can contain up to five characters.

See also: CurrencyRtStr


TOvcIntlSup.CurrencyRtStr
CurrencyRtStr property

property TOvcIntlSup.CurrencyRtStr : TCurrencySt

TCurrencySt = array[0..5] of Char;

Default: ''

CurrencyRtStr holds the character(s) placed to the right of a currency value.

Normally, this property is an empty string, but it can contain up to five characters.

See also: CurrencyLtStr


TOvcIntlSup.CurrentDateString
CurrentDateString method

function TOvcIntlSup.CurrentDateString(const Picture : string; Pack : Boolean) : string;

CurrentDateString returns today's date as a string.

This method calls OvcDT.CurrentDate to get the current date, then converts it (using DateToDateString) to a string of the form specified by Picture. If Pack is True, CurrentDateString compresses non-literal spaces in the returned string.

The following example gets today's date as a string of the form 'MM/DD/yyyy' with extraneous spaces removed.

S := CurrentDateString('MM/DD/yyyy', True);

See also: CurrentTimeString, DateToDateString


TOvcIntlSup.CurrentTimeString
CurrentTimeString method

function TOvcIntlSup.CurrentTimeString(const Picture : string; Pack : Boolean) : string;

CurrentTimeString returns the current time as a string.

This method calls OvcDT.CurrentTime to get the current time, then converts it (using TimeToTimeString) to a string of the form specified by Picture. If Pack is True, CurrentTimeString compresses non-literal spaces in the returned string.

The following example gets the current time as a string of the form 'hh:mm:ss tt'.

S := CurrentTimeString('hh:mm:ss tt', False);

See also: CurrentDateString, TimeToTimeString


TOvcIntlSup.DMYtoDateString
DMYtoDateString method

function TOvcIntlSup.DMYtoDateString(const Picture : string; Day, Month, Year : Integer; Pack : Boolean) : string;

DMYtoDateString merges the month, day, and year into a string.

Given a Day, Month, and Year, this method returns a string representation of the date in the format indicated by Picture. The date string is returned as the function result. If Year is less than 100, it is assumed to be relative to 1900. If Pack is True, DMYtoDateString compresses non-literal spaces in the returned string.

The following examples both return '12/07/1941'.

S := DMYtoDateString('mm/dd/yyyy', 7, 12, 1941, False);

S := DMYtoDateString('mm/dd/yyyy', 7, 12, 41, False);

See also: DateStringToDMY


TOvcIntlSup.DateStringIsBlank
DateStringIsBlank method

function TOvcIntlSup.DateStringIsBlank(const Picture, S : string) : Boolean;

DateStringIsBlank returns True if the date is blank.

Given a string representation of a date (S), DateStringIsBlank returns True if the month, day, and year in S are all blank.

The following example returns True.

B := DateStringIsBlank('mm/dd/yyyy', '  /  /    ');


TOvcIntlSup.DateStringToDMY
DateStringToDMY method

function TOvcIntlSup.DateStringToDMY(const Picture, S : string; var Day, Month, Year : Integer) : Boolean;

DateStringToDMY extracts the day, month, and year from a date string.

Given a string representation of a date (S), this method extracts the Day, Month, and Year, and returns True if the date is valid. If S is not a string of the same form as Picture, the results are unpredictable.

The following example extracts the day, month, and year for '11/13/1987' returning True, with Day = 13, Month = 11, and Year = 1987.

DateStringToDMY('mm/dd/yyyy', '11/13/1987', Day, Month, Year);

See also: DateToDateString, DMYToDateString


TOvcIntlSup.DateStringToDate
DateStringToDate method

function TOvcIntlSup.DateStringToDate(const Picture, S : string) : TOvcDate;

DateStringToDate converts a string to a Julian date.

Given a string representation of a date (S), this method converts it to a Julian date, returned as the function result. If S is not a string of the same form as Picture, the results are unpredictable. If S is the correct form, but the date represented by S is invalid, BadDate is returned.

The following example returns the Julian date for '01/01/1999'.

D := DateStringToDate('mm/dd/yyyy', '01/01/1999');

See also: DateToDateString, DateStringToDMY


TOvcIntlSup.DateToDateString
DateToDateString method

function TOvcIntlSup.DateToDateString(const Picture : string; Julian : TOvcDate; Pack : Boolean) : string;

DateToDateString converts a Julian date to a string.

Given a date (Julian), this method converts it to a string of the form specified by Picture and returns it as the function result. If Julian equals BadDate, the month, day, and year are represented as blank spaces. If Pack is True, DateToDateString compresses non-literal spaces in the returned string.

The following example returns a string of the form 'MM/DD/yyyy' representing the Julian date contained in MyDateVar with extraneous spaces removed.

S := DateToDateString('MM/DD/yyyy', MyDateVar, True);

See also: DateStringToDate, DMYToDateString


TOvcIntlSup.DayOfWeekToString
DayOfWeekToString method

function TOvcIntlSup.DayOfWeekToString(WeekDay : TDayType) : string;

DayOfWeekToString returns a string for the specified day of the week.

This method returns the name of the specified day of the week as the function result.

The following example returns the string, 'Tuesday'.

S := DayOfWeekToString(Tuesday);


TOvcIntlSup.DecimalChar
DecimalChar property

property TOvcIntlSup.DecimalChar : Char

Default: '.'

DecimalChar is the character displayed to the left of any decimal places.

DecimalChar is initialized to the value in the sDecimal entry in the Windows WIN.INI file.

See also: CommaChar


TOvcIntlSup.FalseChar
FalseChar property

property TOvcIntlSup.FalseChar : Char

Default: 'F'

FalseChar is the character used to display a False condition for True/False fields.

See also: TrueChar


TOvcIntlSup.InternationalCurrency
InternationalCurrency method

function TOvcIntlSup.InternationalCurrency(FormChar : Char; MaxDigits : Byte; Float, AddCommas, IsNumeric : Boolean) : string;

InternationalCurrency returns a picture mask for a currency string.

This method constructs a picture mask for a field containing a monetary value. The mask it returns is typically assigned to the PictureMask property of a TOvcPictureField or TOvcNumericField component.

The generated mask is returned as the function result. FormChar is the formatting character to use ('9', 'I', or '#'). MaxDigits is the number of digits that can appear to the left of the decimal point. (WIN.INI indicates how many, if any, should appear to the right.) Float indicates whether '$' or 'c' should be used if the currency symbol goes on the left. If Float is False, 'c' is used instead of '$'. AddCommas indicates whether discretionary commas should appear in the picture mask. IsNumeric indicates whether or not the mask will be used with a numeric field. If it's True, the returned mask can contain a 'p' or 'g' character; if it's False, it won't.

The returned mask can be as large as 8+MaxDigits characters long, not counting any space set aside for commas (MaxDigits-1 / 3 characters). This is because a currency symbol can be as long as 5 characters, and there is usually a decimal point with two digits on its right as well. (In some cases, a 'p' or 'g' character can appear in the mask as well, but in these cases the currency symbol is never 5 characters long.) Keep this in mind when laying out your forms. If your program is going to change the picture mask based on the result of InternationalCurrency, leave room for the largest picture mask that you might possibly receive.

The following example returns '$iii,iii.ii' for the U.S. (e.g., '$-12,345.67'), 'iii,iii.iiCCC' for Iceland (e.g., '-12.345,67 kr'), '$iii,iii.iip' for Mexico (e.g., '($12,345.67)').

S := InternationalCurrency('i', 6, True, True, True);

The following example returns 'c####.##' for the U.S. (e.g., '$ -12.34'), 'cccc####.##' for Switzerland (e.g., 'Fr. -12.34'), '####.##ccccc' for Portugal (e.g., '1234,56 Esc.').

S := InternationalCurrency('#', 4, False, False, False);

See also: CurrencyLtStr, CurrencyRtStr, CurrencyDigits


TOvcIntlSup.InternationalDate
InternationalDate method

function TOvcIntlSup.InternationalDate(ForceCentury : Boolean) : string;

InternationalDate returns a picture mask for a short date string.

This method uses the international short date information to construct a picture mask for a date string. The mask it returns can be assigned to the PictureMask property of a TOvcPictureField component.

The ForceCentury parameter indicates whether the picture mask should leave room for a century (yyyy) as well as a year (yy), regardless of the preferences indicated in WIN.INI. The constructed picture mask is returned as the function result.

The following example returns 'MM/DD/yy' for the U.S. (e.g., ' 4/ 9/92'), 'DD/MM/yyyy' for Finland (e.g., '09.04.1992'), 'dd/mm/yy' for Denmark (e.g., '09-04-92').

S := InternationalDate(False);

See also: InternationalCurrency, InternationalTime, InternationalLongDate


TOvcIntlSup.InternationalLongDate
InternationalLongDate method

function TOvcIntlSup.InternationalLongDate(ShortNames : Boolean; ExcludeDOW : Boolean) : string;

InternationalLongDate returns a picture mask for a long date string.

This method uses the international long date information to construct a picture mask for a date string. This long date format is rarely used in data entry forms.

ShortNames indicates whether the day of week and month names, if any, should appear in shortened form (Mon instead of Monday, Jan instead of January, etc.). The ExcludeDOW parameter indicates whether the picture mask should omit the day of the week, regardless of the preferences indicated in WIN.INI. The constructed picture mask is returned as the function result.

The following example returns 'wwwwwwwww, nnnnnnnnn dd, yyyy' for the U.S. (e.g., 'Thursday , March    26, 1992').

S := InternationalLongDate(False, False);

The following example returns 'www, nnn dd, yyyy' for the U.S. (e.g., 'Thu, Mar 26, 1992').

S := InternationalLongDate(True, False);

The following example returns 'nnn dd, yyyy' for the U.S. (e.g., 'Mar 26, 1992').

S := InternationalLongDate(True, True);

See also: InternationalCurrency, InternationalDate, InternationalTime


TOvcIntlSup.InternationalTime
InternationalTime method

function TOvcIntlSup.InternationalTime(ShowSeconds : Boolean) : string;

InternationalTime returns a picture mask for a time string.

This method uses the international time information to construct a picture mask for a time string or an entry field containing a time. The mask it returns as the function result can be assigned to the PictureMask property of a TOvcPictureField component.

The ShowSeconds parameter indicates whether the mask should include seconds as well as minutes and hours.

The following example returns 'HH:mm:ss tt' for the U.S. (e.g., ' 1:40:21 PM'), 'Hh:mm:ss' for Italy (e.g., '13.40.21'), 'hh:mm:ss' for Switzerland (e.g., '13,40,21').

S := InternationalTime(True);

See also: InternationalCurrency, InternationalDate, InternationalLongDate


TOvcIntlSup.MonthStringToMonth
MonthStringToMonth method

function TOvcIntlSup.MonthStringToMonth(const S : string; Width : Byte) : Byte;

MonthStringToMonth converts a month number to a month name.

This method returns the month number that corresponds to the month name specified in S. Width indicates the number of characters to use when comparing S with the internal array of month names. The comparison is not case sensitive.

The following example returns 6.

M := MonthStringToMonth('Jun', 3);

See also: MonthToString


TOvcIntlSup.MonthToString
MonthToString method

function TOvcIntlSup.MonthToString(Month : Integer) : string;

MonthToString returns the month as a string.

This method returns the name of the specified month as the function result.

The following example returns 'March'.

S := MonthToString(3);

See also: MonthStringToMonth


TOvcIntlSup.NoChar
NoChar property

property TOvcIntlSup.NoChar : Char

Default: 'N'

NoChar is the character that indicates a False condition for Yes/No fields.

See also: YesChar


TOvcIntlSup.OnWinIniChange
OnWinIniChange event

property TOvcIntlSup.OnWinIniChange : TNotifyEvent

OnWinIniChange defines an event handler that is called when Windows broadcasts the WM_WININICHANGE message.

The method assigned to the OnWinIniChange event is called when Windows informs the TOvcIntlSup object that the WIN.INI file has been changed. This occurs only if the AutoUpdate property is set to True. If the AutoUpdate property is False, the TOvcIntlSup object does not create a window handle and therefore can not receive any window messages.

This event provides you an opportunity to inspect and possibly change any properties that might have been updated because of the changes to the WIN.INI file.


TOvcIntlSup.ResetInternationalInfo
ResetInternationalInfo method

procedure TOvcIntlSup.ResetInternationalInfo;

ResetInternationalInfo resets international property values.

This method updates all property values to match the current settings in WIN.INI.


TOvcIntlSup.SlashChar
SlashChar property

property TOvcIntlSup.SlashChar : Char

Default: '/'

SlashChar is the character used to separate string date values.


TOvcIntlSup.TimeStringToHMS
TimeStringToHMS method

function TOvcIntlSup.TimeStringToHMS(const Picture, S : string; var Hour, Minute, Second : Integer) : Boolean;

TimeStringToHMS extracts hours, minutes, seconds from a time string.

Given a string representation of a time (S), this method converts it to Hour, Minute, and Second. If S is not a string of the same form as Picture, the results are unpredictable. If S is the correct form, but the date represented by S is invalid, the function returns False.

The following example returns True, with Hour = 1, Minute = 2, and Second = 3.

TimeStringToHMS('hh:mm:ss', '01:02:03', Hour, Minute, Second);

See also: TimeStringToTime, TimeToAmPmString, TimeToTimeString


TOvcIntlSup.TimeStringToTime
TimeStringToTime method

function TOvcIntlSup.TimeStringToTime(const Picture, S : string) : TOvcTime;

TimeStringToTime converts a time string to a time variable.

Given a string representation of a time (S), this method converts it to a time variable, returned as the function result. If S is not a string of the same form as Picture, the results are unpredictable. If S is the correct form, but the date represented by S is invalid, BadTime is returned.

The following example returns the time value representing 1:02:03 am.

T := TimeStringToTime('hh:mm:ss', '01:02:03');

See also: TimeStringToHMS, TimeToAmPmString, TimeToTimeString


TOvcIntlSup.TimeToAmPmString
TimeToAmPmString method

function TOvcIntlSup.TimeToAmPmString(const Picture : string; T : TOvcTime; Pack : Boolean) : string;

TimeToAmPmString converts a time variable to a time string in am/pm format.

This method is identical to TimeToTimeString except that it forces the time designated by T to be represented in am/pm format, even if the Picture mask does not require it. If T equals BadTime, the hour, minutes, and seconds are represented as spaces in the returned string. If Pack is True, TimeToAmPmString compresses non-literal spaces in the returned string.

The following example sets S1 = '12:00:00', S2 = '00:00:00', and S3 = '  :  :  '.

S1 := TimeToAmPmString('hh:mm:ss', 0, False);

S2 := TimeToTimeString('hh:mm:ss', 0, False);

S3 := TimeToAmPmString('hh:mm:ss', BadTime, False);

See also: TimeToTimeString


TOvcIntlSup.TimeToTimeString
TimeToTimeString method

function TOvcIntlSup.TimeToTimeString(const Picture : string; T : TOvcTime; Pack : Boolean) : string;

TimeToTimeString converts a time variable to a time string.

Given a time of day (T), this routine converts it to a string of the form specified by Picture and returns it as the function result. If T equals BadTime, the hour, minutes, and seconds are represented as spaces in the returned string. If Pack is True, TimeToTimeString compresses non-literal spaces in the returned string.

The following example returns a string representation of the time value contained in MyTimeVar.

S := TimeToTimeString('hh:mm:ss', MyTimeVar, False);

See also: TimeStringToHMS, TimeStringToTime, TimeToAmPmString


TOvcIntlSup.TrueChar
TrueChar property

property TOvcIntlSup.TrueChar : Char

Default: 'T'

TrueChar is the character that indicates a True condition for True/False fields.

See also: FalseChar


TOvcIntlSup.YesChar
YesChar property

property TOvcIntlSup.YesChar : Char

Default: 'Y'

YesChar is the character that indicates a True condition for Yes/No fields.

See also: NoChar


TOvcIntlSup.events
TOvcIntlSup events

OnWinIniChange


TOvcIntlSup.methods
TOvcIntlSup methods

ClassInfo	FreeInstance

ClassName	InheritsFrom

ClassParent	InitInstance

ClassType	InstanceSize

Create	InternationalCurrency

CurrentDateString	InternationalDate

CurrentTimeString	InternationalLongDate

DateStringIsBlank	InternationalTime

DateStringToDate	MethodAddress

DateStringToDMY	MethodName

DateToDateString	MonthStringToMonth

DayOfWeekToString	MonthToString

DefaultHandler	NewInstance

Destroy	ResetInternationalInfo

Dispatch	TimeStringToHMS

DMYtoDateString	TimeStringToTime

FieldAddress	TimeToAmPmString

Free	TimeToTimeString


TOvcIntlSup.properties
TOvcIntlSup properties

AutoUpdate 	FalseChar

CommaChar 	NoChar

CurrencyDigits 	SlashChar

CurrencyLtStr 	TrueChar

CurrencyRtStr 	YesChar

DecimalChar


TOvcMeter
 TOvcMeter component

See also: properties, events, methods, hierarchy

Component Overview

The TOvcMeter component is a horizontal or vertical progress indicator. Meter components are normally displayed during processes that cannot be interrupted and where some form of progress feedback is appropriate.

For operations that take a very small amount of time to complete, displaying the hourglass cursor is sufficient. Longer delays should display some other type of visual feedback at regular intervals so that the user does not think that the application has stopped.

The TOvcMeter component fulfills this requirement by providing a simple progress bar that can be displayed in different sizes to correspond with the state of current process.

The TOvcMeter gives you some nice additional features too. You can optionally display the percentage as a number at the center of the component. You can also configure the color for both sections (left and right or top and bottom), the shadow for both sections, and the color of the line dividing the sections.


TOvcMeter hierarchy


TOvcMeter.BorderStyle
BorderStyle property

property TOvcMeter.BorderStyle : TBorderStyle

Default: bsSingle

BorderStyle determines the style used when drawing the border.

The possible values are bsSingle (a single line border is drawn around the component) or bsNone (no border line).

The TBorderStyle type is defined in the Delphi Controls unit.


TOvcMeter.DividerColor
DividerColor property

property TOvcMeter.DividerColor : TColor

Default: clBlack

DividerColor is the color of the divider line.

This property determines the color used to draw the line that divides the "used" and "unused" sections of the progress bar.


TOvcMeter.Orientation
Orientation property

property TOvcMeter.Orientation : TMeterOrientation

TMeterOrientation = (moHorizontal, moVertical);

Default: moHorizontal

Orientation determines whether the meter is horizontal or vertical.

If Orientation is moHorizontal, the meter component is drawn so that the progress bar moves from left to right for increasing values of Percent. If Orientation is moVertical, the meter component is drawn so that the progress bar moves from bottom to top for increasing values of Percent.

See also: Percent


TOvcMeter.Percent
Percent property

property TOvcMeter.Percent : Byte

Default: 33

Percent determines how much of the progress bar is drawn.

Larger values for Percent cause more of the progress bar to display. Valid values for Percent are from 0 to 100. If Percent equals 0, no progress bar is displayed. If Percent equals 100, a complete progress bar is displayed.

The default value (33) has no special meaning. It is used to allow you to view all areas of the meter at design time. You will probably initialize Percent to 0 or 100 at run time.


TOvcMeter.ShowPercent
ShowPercent property

property TOvcMeter.ShowPercent : Boolean

Default: False

ShowPercent determines whether the Percent value is displayed.

This property determines whether the Percent value is displayed numerically at the center of the meter control.

See also: Percent


TOvcMeter.UnusedColor
UnusedColor property

property TOvcMeter.UnusedColor : TColor

Default: clWindow

UnusedColor is the color used to draw the unused portion of the progress bar.


TOvcMeter.UnusedShadow
UnusedShadow property

property TOvcMeter.UnusedShadow : TColor

Default: clWindowFrame

UnusedShadow is the color used to draw the shadow for the unused portion of the progress bar.


TOvcMeter.UsedColor
UsedColor property

property TOvcMeter.UsedColor : TColor

Default: clLime

UsedColor is the color used to draw the used portion of the progress bar.


TOvcMeter.UsedShadow
UsedShadow property

property TOvcMeter.UsedShadow : TColor

Default: clGreen

UsedShadow is the color used to draw the shadow for the used portion of the progress bar.


TOvcMeter.events
TOvcMeter events

OnClick	OnKeyDown

OnDblClick	OnKeyPress

OnDragDrop 	OnKeyUp

OnDragOver 	OnMouseDown

OnEndDrag 	OnMouseMove

OnEnter 	OnMouseUp

OnExit


TOvcMeter.methods
TOvcMeter methods

AlignControls 	HasParent

Assign	Hide

AssignTo 	InheritsFrom

BeginDrag	InitInstance

BringToFront	InsertComponent

Broadcast	InsertControl

CanFocus	InstanceSize

ChangeName 	Invalidate

ChangeScale 	IsControlMouseMsg

ClassInfo	KeyDown

ClassName	KeyPress

ClassParent	KeyUp

ClassType	Loaded

Click 	MainWndProc

ClientToScreen	MethodAddress

ContainsControl	MethodName

ControlAtPos	MouseDown

Create	MouseMove

CreateHandle 	MouseUp

CreateSubClass 	NewInstance

CreateWindowHandle 	NotifyControls

DblClick 	PaintControls

DefaultHandler 	PaintHandler

DefineProperties 	PaintWindow

Destroy	PaletteChanged

DestroyComponents	Perform

DestroyHandle 	ReadState

Destroying	Realign

DestroyWindowHandle 	RecreateWnd

DestroyWnd 	Refresh

DisableAlign	RemoveComponent

Dispatch	RemoveControl

DoEnter 	Repaint

DoExit 	ScaleBy

DoKeyDown 	ScaleControls

DoKeyPress 	ScreenToClient

DoKeyUp 	ScrollBy

DragCanceled 	SelectFirst

Dragging	SelectNext

EnableAlign	SendToBack

EndDrag	SetBounds

FieldAddress	SetDesigning

FindComponent	SetFocus

FindNextControl 	SetName

Focused	SetParent

Free	SetTextBuf

FreeInstance	SetZOrder

GetClientOrigin 	Show

GetClientRect 	ShowControl

GetDeviceContext 	Update

GetPalette 	UpdateBoundsRect

GetTabOrderList	ValidateRename

GetTextBuf	VisibleChanging

GetTextLen	WndProc

HandleAllocated	WriteComponents

HandleNeeded	WriteState


TOvcMeter.properties
TOvcMeter properties

Align	HelpContext

BorderStyle	Hint

BoundsRect 	IsControl

Brush 	Left

Canvas  	MouseCapture

Caption  	Name

ClientHeight 	Orientation

ClientOrigin 	Owner

ClientRect 	Parent

ClientWidth 	ParentColor

Color  	ParentCtl3D

ComponentCount 	ParentFont

ComponentIndex 	ParentShowHint

Components 	Percent

ComponentState 	PopupMenu

ControlCount 	ShowHint

Controller  	Showing

Controls 	ShowPercent

ControlState 	TabOrder

ControlStyle 	TabStop

Ctl3D	Tag

Cursor	Text

DefWndProc  	Top

DesignInfo 	UnusedColor

DividerColor	UnusedShadow

DragCursor  	UsedColor

DragMode  	UsedShadow

Enabled 	Visible

Font	Width

Handle 	WindowHandle

Height


TOvcNotebook
 TOvcNotebook component

See also: properties, events, methods, hierarchy

Component Overview

The TOvcNotebook component implements tabbed notebook pages that can be displayed at the top or to the right of the pages.

For notebooks with their tabs placed at the top of the notebook page, the meaning of the TabHeight and TabWidth properties is apparent from their names. When tabs are placed at the right of the notebook pages, TabWidth refers to the vertical distance and TabHeight refers to the horizontal distance.

A notebook can have any number of tabs and as many rows of tabs. As tabs are added or removed (via the Pages property), the number of tab rows is automatically adjusted so that the tabs occupy the full width of the notebook. If the notebook width increases, tabs are moved to minimize the number of rows.

To increase the number of tab rows, temporarily decrease the width of the notebook (Width) until the appropriate number of tab rows is displayed and then size the notebook to the width you desire (increasing the TabWidth to circumvent the notebook's attempt to minimize the number of rows). To decrease the number of tab rows, either increase the width of the notebook (Width) or decrease the width of the tabs (TabWidth) and the notebook optimizes the number of tab rows.

TOvcNotebook provides several design-time features that enable easy manipulation of properties such as the PageIndex, TabIndent, and TabWidth. PageIndex is the index (zero-based) of the active notebook page. TabIndent is the number of pixels each row of tabs is indented from the row below. TabWidth is the width in pixels of the notebook tabs.

You can select the active page by changing the PageIndex property directly within the Object Inspector or by simply clicking on the tab using the mouse. Note that at design time, the mouse cursor changes shape as you move it over any of the notebook tabs to indicate that the tab can be selected.

The TabIndent property can be set by entering a value in the corresponding Object Inspector's field or by using the mouse. To use the mouse to adjust the tab indent, position the mouse cursor over the left edge of the first tab in the second (topmost or rightmost) row of tabs and then click and drag to adjust the indent. The TabIndent property value in the Object Inspector is updated as you do this. There must be two or more rows of tabs before TabIndent is meaningful since the first (lowest or leftmost) row of tabs are not indented.

To adjust the TabWidth, the process is the same as for TabIndent, except that you position the mouse over the right or bottom edge of the notebook. The TabWidth property value in the Object Inspector is updated as you adjust the tab widths. Note that at design time, the mouse cursor changes shape as the mouse moves over the sizing region to indicate that the TabIndent or TabWidth can be changed.

TOvcNotebook provides several indexed properties that allow easy run-time access to individual pages. The PageHelpContexts indexed property allows you to manipulate the help context ID's associated with each notebook page. PageHints allows access to the help text associated with each page. PagesEnabled allows you to disable and enable individual notebook pages. PagesVisible is used much like the PagesEnabled property except that the disabled page's tab is not displayed. TabsTextColor allows you to alter the text color used in drawing the page name on the notebook tabs.


TOvcNotebook hierarchy


TOvcNotebook.ActivePageName
ActivePageName property

property TOvcNotebook.ActivePageName : string

ActivePageName determines the active page.

The ActivePageName property determines which page is the active or topmost page. Assigning another valid page name to this property or selecting one of the available page names from the Object Inspector's list makes that page the active page. Assigning a value that does not match any of the existing notebook page names causes no harm and is ignored. The text comparison is case-insensitive.

This property cannot be used to change the name displayed on a notebook page tab. Use the PageName or Pages property to change a page name.

See also: PageIndex, PageName, Pages


TOvcNotebook.ConserveResources
ConserveResources property

property TOvcNotebook.ConserveResources : Boolean

Default: False

ConserveResources determines if the window handles of inactive notebook pages are freed.

The ConserveResources property determines if the window handle associated with a notebook page is freed when the page is not the active page. Freeing the page window handle also frees the window handles of all components on that page.

If ConserveResources is set to True, Windows resources are not used for a notebook page until that page is made the active page. Selecting a different page as the active page frees the window handle of the current active page before making the newly selected page active.

Freeing window handles has no effect on non-visual components or components that have no window handle.

Use of this property shouldn't have any negative effects on the operation of the notebook or its components as long as the components are designed to preserve their data across a window re-creation. All of the standard Orpheus and VCL components support this.


TOvcNotebook.EchoPageHelp
EchoPageHelp property

property TOvcNotebook.EchoPageHelp : Boolean

Default: False

EchoPageHelp determines if the help context ID for individual notebook pages is copied to the notebook's HelpContext property.

If EchoPageHelp is True, the notebook's HelpContext property is updated to reflect the help context ID of the active page. This allows you to provide context-sensitive help for each page of the notebook by obtaining the notebook's HelpContext value to pass to your help routine.

See also: EchoPageHint


TOvcNotebook.EchoPageHint
EchoPageHint property

property TOvcNotebook.EchoPageHint : Boolean

Default: False

EchoPageHint determines if the hint text for individual notebook pages is copied to the notebook's Hint property.

If EchoPageHint is True, the notebook's Hint property is updated to reflect the hint text of the active page. This allows you to display page-specific hint text by obtaining the notebook's Hint string.

See also: EchoPageHelp


TOvcNotebook.GetTabRect
GetTabRect method

function TOvcNotebook.GetTabRect(Index : Integer) : TRect;

GetTabRect returns the bounding rectangle for the specified tab.

Index is the index of one of the notebook pages. The function result is a TRect structure that bounds the specified tab.


TOvcNotebook.HighlightColor
HighlightColor property

property TOvcNotebook.HighlightColor : TColor

Default: clBtnHighlight

HighlightColor determines the color used to display the highlighted edge of the notebook and tabs.

The highlighted edge is the top and left border of the notebook and tabs.


TOvcNotebook.IsValid
IsValid method

function TOvcNotebook.IsValid(Index : Integer) : Boolean;

IsValid tells whether the specified page index is valid.

IsValid returns True if Index is a valid page index. The valid range for page indexes is 0 to the number of notebook pages - 1. An index that is in the valid range is also invalid if the page is disabled or hidden.

The following example tests the validity of an index before attempting to use it to change the active page.

if IsValid(SomeIndex) then

  PageIndex := SomeIndex

else

  {do something here}

The following example uses exceptions to perform the same operation.

try

  PageIndex := SomeIndex;

except

  on EInvalidPageIndex do

    {do something here and/or re-raise the exception}

end;

See also: PageIndex, PagesVisible


TOvcNotebook.OnMouseOverTab
OnMouseOverTab event

property TOvcNotebook.OnMouseOverTab : TMouseOverTabEvent

TMouseOverTabEvent = procedure(Sender : TObject; Index : Integer) of object;

OnMouseOverTab defines an event handler that is called when the mouse moves over one of the notebook's tabs.

This event is generated for each mouse movement over a notebook tab. If the mouse is moved within a tab, a continuous stream of events is generated. Index is the page index of the tab. Sender is the instance of the notebook.

The following example shows how to detect mouse movement over one of the notebook tabs. In this example, when the mouse is moved over the tab with an index value of 1, the computer generates a beep.

procedure TForm1.OvcNotebook1MouseOverTab(Sender: TObject; Index: Integer);

begin

  if Index = 1 then

    MessageBeep(0);

end;

...

OnMouseOverTab := Form1.OvcNotebook1MouseOverTab;


TOvcNotebook.OnPageChange
OnPageChange event

property TOvcNotebook.OnPageChange : TPageChangeEvent

TPageChangeEvent = procedure(Sender : TObject; Index : Integer; var AllowChange : Boolean) of object;

OnPageChange defines an event handler that is called when a notebook page is selected.

The method assigned to the OnPageChange event is called to provide notification of a notebook page change. Index is the index value of the new notebook page. You can disallow the page change by setting AllowChange to False.

The following example shows how to reject the selection of a page. In this example, if the mouse is clicked on the tab with a page index of 5, AllowChange is set to False. This informs the notebook object not to change the active tab.

procedure TForm1.OvcNotebook1PageChange(Sender : TObject; Index : Integer;

                                        var AllowChange : Boolean);

begin

  if Index = 5 then

    AllowChange := False;

end;

...

OnPageChange := Form1.OvcNotebook1PageChange;

See also: OnPageChanged


TOvcNotebook.OnPageChanged
OnPageChanged event

property TOvcNotebook.OnPageChanged : TPageChangedEvent

TPageChangedEvent = procedure(Sender : TObject; Index : Integer) of object;

OnPageChanged defines an event handler that is called after a new notebook page is selected.

The method assigned to the OnPageChanged event is called after a new notebook page is selected. Index is the index number of the new page.

The following example updates a TLabel component with the name of the new notebook page.

procedure TForm1.OvcNotebook1PageChanged(Sender : TObject; Index : Integer);

begin

  Label1.Caption := OvcNotebook1.Pages[Index];

end;

...

OnPageChanged := Form1.OvcNotebook1PageChanged;

See also: OnPageChange, Pages


TOvcNotebook.OnTabClick
OnTabClick event

property TOvcNotebook.OnTabClick : TTabClickEvent

TTabClickEvent = procedure(Sender : TObject; Index : Integer) of object;

OnTabClick defines an event handler that is called when a mouse click is made on a notebook tab.

The method assigned to the OnClick event is called to provide notification of a mouse click on a notebook tab. Index is the page index of the tab and can be the same as the active page index.

The following example updates a TLabel component with the page name for the tab that was clicked on.

procedure TForm1.OvcNotebook1TabClick(Sender : TObject; Index : Integer);

begin

  Label2.Caption := OvcNotebook1.Pages[Index];

end;

...

OnTabClick := Form1.OvcNotebook1TabClick;

See also: OnMouseOverTab, Pages


TOvcNotebook.OnUserCommand
OnUserCommand event

property TOvcNotebook.OnUserCommand : TUserCommandEvent

TUserCommandEvent = procedure(Sender : TObject; Command : Word) of object;

OnUserCommand defines an event handler that is called when a user-defined command is entered.

The method assigned to the OnUserCommand event is called when you enter the key sequence corresponding to one of the user-defined commands (ccUser1, ccUser2, etc.).

For example, suppose you add the <F9> key sequence to one of the active command tables and assign it to the ccUser1 command. When you press <F9>, the method assigned to the OnUserCommand event is called and ccUser1 is passed in Command.

See TOvcCommandProcessor Class for additional information about user-defined commands and command tables.


TOvcNotebook.PageEnabled
PageEnabled property

property TOvcNotebook.PageEnabled : Boolean

PageEnabled determines the enabled status of the active notebook page.

See also: PagesEnabled


TOvcNotebook.PageHelpContext
PageHelpContext  property

property TOvcNotebook.PageHelpContext : THelpContext

PageHelpContexts provides access to the HelpContext property for the active notebook page.

See also: PageHelpContexts


TOvcNotebook.PageHelpContexts
PageHelpContexts run-time property

property TOvcNotebook.PageHelpContexts[Index : Integer] : THelpContext

PageHelpContexts provides access to the HelpContext property for all notebook pages.

This indexed property allows you to set the help context ID's for all notebook pages. Index is the index of one of the notebook pages.


TOvcNotebook.PageHint
PageHint property

property TOvcNotebook.PageHint : string

PageHint provides access to the Hint property for the active notebook page.

See also: PageHints


TOvcNotebook.PageHints
PageHints run-time property

property TOvcNotebook.PageHints[Index : Integer] : string

PageHints provides access to the Hint property for all notebook pages.

This indexed property allows you to set the Hint property for all notebook pages. Index is the index of one of the notebook pages.


TOvcNotebook.PageIndex
PageIndex property

property TOvcNotebook.PageIndex : Integer

Default: the active notebook page index

PageIndex is the index of the active notebook page.

PageIndex allows access to the index of the active notebook page and allows you to change the active notebook page. If you set PageIndex to an invalid page index, an EInvalidPageIndex exception is raised. The valid range for page indexes is 0 to the number of notebook pages - 1. An index that is in the valid range is invalid at run time if the page is disabled or hidden.

See also: IsValid, PagesVisible


TOvcNotebook.PageName
PageName property

property TOvcNotebook.PageName : string

PageName is the name of the active notebook page.

Use PageName to retrieve or assign the active notebook page name. Alternatively, you can use the Pages property to access and change any of the notebook page names.

See also: Pages


TOvcNotebook.PageNameToIndex
PageNameToIndex method

function TOvcNotebook.PageNameToIndex(const Name : string) : Integer;

PageNameToIndex returns the index of the specified page.

Given a notebook page name, PageNameToIndex returns its corresponding page index. If Name does not match any of the notebook page names, -1 is returned. The text comparison is not case sensitive.


TOvcNotebook.Pages
Pages property

property TOvcNotebook.Pages : TStrings

Pages provides access to the internal TPageAccess object (a descendant of TStrings) used to store the notebook pages.

At run time, Pages allows access to the notebook page name using the Get and Put methods and access to the notebook pages (TOvcNotebookPage) using the GetObject method. See the Delphi TStrings class for information about the methods and properties available.

At design time, the following property editor provides access to the page name, enabled status, hint text, and help context. You can add, delete, and edit these properties.

The arrow buttons are used to change the order of the notebook pages. Clicking the up button moves the selected page one position up in the order, and clicking the down button moves the selected page one position down.


TOvcNotebook.PagesEnabled
PagesEnabled run-time property

property TOvcNotebook.PagesEnabled[Index : Integer] : Boolean

PagesEnabled determines the enabled status of all notebook pages.

This indexed property determines the enabled status of all of the notebook pages. Index is the index of one of the notebook pages.

See also: PagesVisible


TOvcNotebook.PagesVisible
PagesVisible run-time property

property TOvcNotebook.PagesVisible[Index : Integer] : Boolean

PagesVisible determines if a notebook page is hidden.

This indexed property is used to hide and show individual notebook pages. If PagesVisible is set to True, the page indicated by Index is displayed. If False, the notebook page and corresponding tab are hidden and the position where the tab was displayed is removed.

See also: IsValid


TOvcNotebook.ShadowColor
ShadowColor property

property TOvcNotebook.ShadowColor : TColor

Default: clBtnShadow

ShadowColor is the color of the shadowed edge of the notebook and tabs.

The shadowed edge is the bottom and right border of the notebook and tabs.

See also: HighlightColor


TOvcNotebook.ShadowedText
ShadowedText property

property TOvcNotebook.ShadowedText : Boolean

Default: False

ShadowedText determines if tab text is drawn using shadows.

If ShadowedText is True, the page names displayed on the tabs are drawn using shadowed text. Shadowing gives the text a 3D Look.

See also: TextShadowColor


TOvcNotebook.TabAutoHeight
TabAutoHeight property

property TOvcNotebook.TabAutoHeight : Boolean

Default: True

TabAutoHeight determines if the tab height is adjusted automatically when the tab font changes.

If TabAutoHeight is True, the height of the notebook tabs is automatically adjusted based on the height of the current font.

See also: TabHeight


TOvcNotebook.TabHeight
TabHeight property

property TOvcNotebook.TabHeight : LongInt

Default: 20 (if TabAutoHeight is False)

TabHeight is the height of the notebook tabs.

Assigning a value (in pixels) to TabHeight adjusts the height of all of the notebook tabs and sets TabAutoHeight to False.

See also: TabAutoHeight, TabWidth


TOvcNotebook.TabIndent
TabIndent property

property TOvcNotebook.TabIndent : LongInt

Default: 8

TabIndent is the indentation for notebook tabs.

TabIndent is the indentation (in pixels) for the second and subsequent rows of notebook tabs. For example, if TabIndent is 20, the second and subsequent rows of tabs are 20 pixels to the right of the row below them. The first row of tabs (the ones closest to the notebook page) are not indented.

TabIndent can be set at design time in the Object Inspector or by using the mouse. To adjust the tab indent using the mouse, position the mouse cursor over the left edge of the first tab in the second row of tabs and then click and drag.

See also: TabHeight, TabWidth


TOvcNotebook.TabOrientation
TabOrientation property

property TOvcNotebook.TabOrientation : TTabOrientation

TTabOrientation = (toTop, toRight);

Default: toTop

TabOrientation determines whether top or right-side tabs are used.

TabOrientation determines whether the notebook is drawn with tabs at the top edge (toTop) or with tabs at the right edge (toRight). If TabOrientation is set to toRight, the font is automatically changed to Courier New, if it isn't already. That is because the text drawn on the tabs must be rotated, and only TrueType fonts can be rotated.


TOvcNotebook.TabTextColor
TabTextColor property

property TOvcNotebook.TabTextColor : TColor

TabTextColor provides access to the tab text color property for the active notebook page.

See also: TabsTextColor


TOvcNotebook.TabWidth
TabWidth property

property TOvcNotebook.TabWidth : LongInt

Default: 65

TabWidth is the width of the notebook page tabs.

All tabs have the same width. The visible width of the notebook is the sum of the widths of all the tabs in the first row, plus the value of TabIndent (if there is more than one row of tabs). Row 0 is the bottom or left row.

TabWidth can be set at design time in the Object Inspector or by using the mouse. To adjust the tab width using the mouse, position the mouse cursor over the right edge of the notebook and then click and drag.

See also: TabHeight, TabIndent


TOvcNotebook.TabsTextColor
TabsTextColor run-time property

property TOvcNotebook.TabsTextColor[Index : Integer] : TColor

TabsTextColor provides access to the tab text color property for all notebook pages.

This indexed property allows access to the color used to draw the text on each notebook tab. Index is the index of one of the notebook pages.

The following example sets the text color of the third notebook tab to red. Notice that the array is zero-based.

TabsTextColor[2] := clRed;


TOvcNotebook.TextShadowColor
TextShadowColor property

property TOvcNotebook.TextShadowColor : TColor

Default: clButtonShadow

TextShadowColor is the color used to draw the text shadow on notebook tabs.

If ShadowedText is False, TextShadowColor is not used.

See also: ShadowedText


TOvcNotebook.events
TOvcNotebook events

OnClick	OnKeyUp

OnDblClick	OnMouseDown

OnDragDrop	OnMouseMove

OnDragOver	OnMouseOverTab

OnEndDrag	OnMouseUp

OnEnter	OnPageChange

OnExit	OnPageChanged

OnKeyDown	OnTabClick

OnKeyPress	OnUserCommand


TOvcNotebook.methods
TOvcNotebook methods

AlignControls 	GetTextLen

Assign	HandleAllocated

AssignTo 	HandleNeeded

BeginDrag	HasParent

BringToFront	Hide

Broadcast	InheritsFrom

CanFocus	InitInstance

ChangeName 	InsertComponent

ClassInfo	InsertControl

ClassName	InstanceSize

ClassParent	Invalidate

ClassType	IsControlMouseMsg

Click 	IsValid

ClientToScreen	KeyDown

ContainsControl	KeyPress

ControlAtPos	KeyUp

Create	MainWndProc

CreateHandle 	MethodAddress

CreateSubClass 	MethodName

CreateWindowHandle 	NewInstance

DblClick 	NotifyControls

DefaultHandler 	PageNameToIndex

DefineProperties 	PaintControls

Destroy	PaintHandler

DestroyComponents	PaintWindow

DestroyHandle 	PaletteChanged

Destroying	Perform

DestroyWindowHandle 	Realign

DestroyWnd 	RecreateWnd

DisableAlign	Refresh

Dispatch	RemoveComponent

DoEnter 	RemoveControl

DoExit 	Repaint

DoKeyDown 	ScaleBy

DoKeyPress 	ScaleControls

DoKeyUp 	ScreenToClient

DragCanceled 	ScrollBy

Dragging	SelectFirst

EnableAlign	SelectNext

EndDrag	SendToBack

FieldAddress	SetDesigning

FindComponent	SetFocus

FindNextControl 	SetName

Focused	SetParent

Free	SetTextBuf

FreeInstance	SetZOrder

GetClientOrigin 	Show

GetClientRect 	Update

GetDeviceContext 	UpdateBoundsRect

GetPalette 	ValidateRename

GetTabOrderList	VisibleChanging

GetTabRect	WndProc

GetTextBuf	WriteState


TOvcNotebook.properties
TOvcNotebook properties

ActivePageName	Name

Align	Owner

BoundsRect 	PageEnabled

Brush 	PageHelpContext

Canvas  	PageHelpContexts

Caption  	PageHint

ClientHeight 	PageHints

ClientOrigin 	PageIndex

ClientRect 	PageName

ClientWidth 	Pages

Color	PagesEnabled

ComponentCount 	PagesVisible

ComponentIndex 	Parent

Components 	ParentColor

ComponentState 	ParentCtl3D

ConserveResources	ParentFont

ControlCount 	ParentShowHint

Controller	PopupMenu

Controls 	ShadowColor

ControlState 	ShadowedText

ControlStyle 	ShowHint

Ctl3D	Showing

Cursor	TabAutoHeight

DefWndProc  	TabHeight

DesignInfo 	TabIndent

DragCursor	TabOrder

DragMode	TabOrientation

EchoPageHelp	TabsTextColor

EchoPageHint	TabStop

Enabled	TabTextColor

Font	TabWidth

Handle 	Tag

Height	Text

HelpContext	TextShadowColor

HighlightColor	Top

Hint	Visible

IsControl  	Width

Left	WindowHandle

MouseCapture


TOvcNumericArrayEditor
 TOvcNumericArrayEditor component

See also: properties, events, methods, hierarchy

Component Overview

The TOvcNumericArrayEditor component is derived from a TOvcBaseArrayEditor. The TOvcNumericArrayEditor edit cells are just TOvcNumericFields. The PictureMask property behaves just like the TOvcNumericField property of the same name.


TOvcNumericArrayEditor hierarchy


TOvcNumericArrayEditor.DataType
DataType property

property TOvcNumericArrayEditor.DataType : TNumericDataType

Default: nftReal

DataType is the type of data that the array editor will process.

The possible values and their corresponding Pascal data types are:

nftLongInt	LongInt

nftWord	Word

nftInteger	Integer

nftByte	Byte

nftShortInt	ShortInt

nftReal	Real

nftExtended	Extended

nftDouble	Double

nftSingle	Single

nftComp	Comp


TOvcNumericArrayEditor.PictureMask
PictureMask property

property TOvcNumericArrayEditor.PictureMask : TNumericFieldMask

Default: 'iiiiiiii'

PictureMask defines which characters the field accepts and the character format.

This property defines the input and display mask used for the cell. The possible values are:

pmPositive	= '9';	{allows numbers and spaces only}

pmWhole	= 'i';	{allows numbers, spaces, minus}

pmDecimal	= '#';	{allows numbers, spaces, minus, period}

pmScientific	= 'E';	{allows numbers, spaces, minus, period, 'e'}

pmHexadecimal	= 'K';	{allows 0-9 and A-F, forces upper case}

pmBinary	= 'b';	{allows 0-1, space}

The value assigned to PictureMask is not tested for validity. It is possible to assign a mask that is invalid.

You can directly enter a mask string in the PictureMask edit field in the Object Inspector or you can invoke the picture mask property editor to view and select from several example picture masks. Double click the PictureMask property value in the Object Inspector or select the dialog button to display the "Numeric Mask" property editor.


TOvcNumericArrayEditor.events
TOvcNumericArrayEditor events

OnChange	OnGetItemColor

OnClick	OnKeyDown

OnDblClick	OnKeyPress

OnDragDrop	OnKeyUp

OnDragOver	OnMouseDown

OnEndDrag	OnMouseMove

OnEnter	OnMouseUp

OnError	OnSelect

OnExit	OnUserCommand

OnGetItem	OnUserValidation


TOvcNumericArrayEditor.methods
TOvcNumericArrayEditor methods

AlignControls 	Hide

Assign	InheritsFrom

AssignTo 	InitInstance

BeginDrag	InsertComponent

BringToFront	InsertControl

Broadcast	InstanceSize

CanFocus	Invalidate

ChangeName 	IsControlMouseMsg

ChangeScale 	KeyDown

ClassInfo	KeyPress

ClassName	KeyUp

ClassParent	Loaded

ClassType	MainWndProc

Click 	MethodAddress

ClientToScreen	MethodName

ContainsControl	MouseDown

ControlAtPos	MouseMove

Create	MouseUp

CreateHandle 	NewInstance

CreateSubClass 	NotifyControls

CreateWindowHandle 	PaintControls

DblClick 	PaintHandler

DefaultHandler 	PaintWindow

Destroy	PaletteChanged

DestroyComponents	Perform

DestroyHandle 	ReadState

Destroying	Realign

DestroyWindowHandle 	RecreateWnd

DestroyWnd 	Refresh

DisableAlign	RemoveComponent

Dispatch	RemoveControl

DoEnter 	Repaint

DoExit 	ScaleBy

DoKeyDown 	ScaleControls

DoKeyPress 	ScreenToClient

DoKeyUp 	ScrollBy

DragCanceled 	SelectFirst

Dragging	SelectNext

EnableAlign	SendToBack

EndDrag	SetBounds

FieldAddress	SetDesigning

FindComponent	SetFocus

FindNextControl 	SetName

Focused	SetParent

Free	SetTextBuf

FreeInstance	SetZOrder

GetClientOrigin 	Show

GetClientRect 	ShowControl

GetDeviceContext 	Update

GetPalette 	UpdateBoundsRect

GetTabOrderList	ValidateRename

GetTextBuf	VisibleChanging

GetTextLen	WndProc

HandleAllocated	WriteComponents

HandleNeeded	WriteState

HasParent


TOvcNumericArrayEditor.properties
TOvcNumericArrayEditor properties

Align	HelpContext

AutoAdvanceChar	HighlightColors

AutoAdvanceLeftRight	Hint

BeepOnError	IsControl

BorderStyle	ItemIndex

BoundsRect 	Left

Brush 	MouseCapture

Canvas  	Name

Caption  	NumItems

ClientHeight 	Owner

ClientOrigin 	Parent

ClientRect 	ParentColor

ClientWidth 	ParentCtl3D

Color	ParentFont

ComponentCount 	ParentShowHint

ComponentIndex 	PictureMask

Components 	PopupMenu

ComponentState 	RangeHi

ControlCount 	RangeLo

Controller	ReadOnly

Controls 	RowHeight

ControlState 	ShowHint

ControlStyle 	Showing

Ctl3D	TabOrder

Cursor	TabStop

DataType	Tag

DefWndProc  	Text

DesignInfo 	Top

DragCursor	UseScrollBar

DragMode	Visible

Enabled	Width

Font	WindowHandle

Handle

Height


TOvcNumericField
 TOvcNumericField component

See also: properties, events, methods, hierarchy

Component Overview

Numeric fields are similar to picture fields, but they use a calculator-style editor that enters data into the field from right-to-left. For example, in a numeric entry field with a mask of '$999,999.99', assume that the field is initialized to 0, and you enter '1234.5'. Here is what you see as each character is entered:

initially	'      $0.00'

enter '1'	'         $1'

enter '2'	'        $12'

enter '3'	'       $123'

enter '4'	'     $1,234'

enter '.'	'    $1,234.'

enter '5'	'   $1,234.5'

leave field	'  $1,234.50'

As characters are entered, they are inserted at the end of the picture mask (the caret is displayed at the end of the picture mask and it cannot be moved). You can enter more or fewer digits to the right of the decimal point than the mask allows, but not to the left of the decimal point. When the caret is moved out of the field, it is automatically redisplayed in the format specified by the picture mask. When appropriate, the entered value is rounded to conform to the picture mask's requirements. For example, if you enter '1234.567', the field displays '  $1,234.57' when the caret leaves the field.


TOvcNumericField hierarchy


TOvcNumericField.DataType
DataType property

property TOvcNumericField.DataType : TNumericDataType

Default: nftLongInt

DataType determines which type of information the numeric entry field can edit.

The possible values and their corresponding Pascal data types are:

nftLongInt	LongInt

nftWord	Word

nftInteger	Integer

nftByte	Byte

nftShortInt	ShortInt

nftReal	Real

nftExtended	Extended

nftDouble	Double

nftSingle	Single

nftComp	Comp


TOvcNumericField.PictureMask
PictureMask property

property TOvcNumericField.PictureMask : string

Default: '##########'

PictureMask determines which characters the field accepts and the character format.

This property defines the input and display mask used for the entry field. The possible values are:

pmPositive	= '9';	{allows numbers and spaces only}

pmWhole	= 'i';	{allows numbers, spaces, minus}

pmDecimal	= '#';	{allows numbers, spaces, minus, period}

pmHexadecimal	= 'K';	{allows 0-9 and A-F, forces upper case}

pmBinary	= 'b';	{allows 0-1, space}

The value assigned to PictureMask is not tested for validity. It is possible to assign a mask that is invalid.

You can directly enter a mask string in the PictureMask edit field in the Object Inspector or you can invoke the picture mask property editor to view and select from several example picture masks. Double click the PictureMask property value in the Object Inspector or select the dialog button to display the "Numeric Mask" property editor.


TOvcNumericField.events
TOvcNumericField events

OnChange	OnKeyDown

OnClick	OnKeyPress

OnDblClick	OnKeyUp

OnDragDrop	OnMouseDown

OnDragOver	OnMouseMove

OnEndDrag	OnMouseUp

OnEnter	OnUserCommand

OnError	OnUserValidation

OnExit


TOvcNumericField.methods
TOvcNumericField methods

AlignControls 	InheritsFrom

Assign	InitInstance

AssignTo 	InsertComponent

BeginDrag	InsertControl

BringToFront	InstanceSize

Broadcast	Invalidate

CanFocus	IsControlMouseMsg

ChangeName 	IsValid

ChangeScale 	KeyDown

ClassInfo	KeyPress

ClassName	KeyUp

ClassParent	Loaded

ClassType	MainWndProc

ClearContents	MethodAddress

ClearSelection	MethodName

Click 	MouseDown

ClientToScreen	MouseMove

ContainsControl	MouseUp

ControlAtPos	MoveCaret

CopyToClipboard	NewInstance

Create	NotifyControls

CreateHandle 	PaintControls

CreateSubClass 	PaintHandler

CreateWindowHandle 	PaintWindow

CutToClipboard	PaletteChanged

DblClick 	PasteFromClipboard

DecreaseValue	Perform

DefaultHandler 	ReadState

Destroy	Realign

DestroyComponents	RecreateWnd

DestroyHandle 	Refresh

Destroying	RemoveComponent

DestroyWindowHandle 	RemoveControl

DestroyWnd 	Repaint

DisableAlign	Restore

Dispatch	ScaleBy

DoEnter 	ScaleControls

DoExit 	ScreenToClient

DoKeyDown 	ScrollBy

DoKeyPress 	SelectAll

DoKeyUp 	SelectFirst

DragCanceled 	SelectNext

Dragging	SendToBack

EnableAlign	SetBounds

EndDrag	SetDesigning

FieldAddress	SetFocus

FieldIsEmpty	SetInitialValue

FindComponent	SetParent

FindNextControl 	SetRangeHi

Focused	SetRangeLo

Free	SetSelection

FreeInstance	SetTextBuf

GetClientOrigin 	SetValue

GetClientRect 	SetZOrder

GetDeviceContext 	Show

GetPalette 	ShowControl

GetTabOrderList	Update

GetTextBuf	UpdateBoundsRect

GetTextLen	ValidateRename

GetValue	ValidateSelf

HandleAllocated	VisibleChanging

HandleNeeded	WndProc

HasParent 	WriteComponents

Hide	WriteState

IncreaseValue


TOvcNumericField.properties
TOvcNumericField properties

Align 	EverModified

AsBoolean 	Font

AsCents 	ForceInsert

AsDateTime 	ForceOvertype

AsExtended 	Handle

AsFloat 	Height

AsInteger 	HelpContext

AsOvcDate 	HighlightColors

AsOvcTime 	Hint

AsString 	InputRequired

AutoAdvanceChar	InsertPushes

AutoAdvanceLeftRight	IntlSupport

AutoAdvanceUpDown	IsControl

AutoSelect	LastError

AutoSize	Left

BeepOnError	MaxLength

BorderStyle	Modified

BoundsRect 	MouseCapture

Brush 	Name

Canvas  	Owner

Caption  	PadChar

CaretIns	Parent

CaretOvr	ParentColor

CaretToEnd 	ParentCtl3D

ClientHeight 	ParentFont

ClientOrigin 	ParentShowHint

ClientRect 	PasswordChar

ClientWidth 	PasswordMode

Color	PictureMask

ComponentCount 	PopupMenu

ComponentIndex 	RangeHi

Components 	RangeLo

ComponentState 	ReadOnly

ControlCharColor  	RightJustify

ControlCount 	SelectedText

Controller	SelectionLength

Controls 	SelectionStart

ControlState 	ShowHint

ControlStyle 	Showing

Ctl3D	SoftValidation

CurrentPos 	StripLiterals

Cursor	TabOrder

DataSize 	TabStop

DataType	Tag

DecimalPlaces 	Text

DefWndProc  	Top

DesignInfo 	TrimBlanks

DisplayString 	Uninitialized

DragCursor	UserData

DragMode	Visible

EditString 	Width

Enabled	WindowHandle

ErrorColors


TOvcPictureArrayEditor
 TOvcPictureArrayEditor component

See also: properties, events, methods, hierarchy

Component Overview

The TOvcPictureArrayEditor component is derived from a TOvcBaseArrayEditor. The TOvcPictureArrayEditor edit cells are just TOvcPictureFields. The PictureMask, MaxLength, and DecimalPlaces properties behave just like the TOvcPictureField properties of the same name.

You can link multiple array editors (even ones of different types) so that scroll actions in one are automatically reflected in the others. See the AEDEMO project in the source code for an example of how to accomplish this.


TOvcPictureArrayEditor hierarchy


TOvcPictureArrayEditor.DataType
DataType property

property TOvcPictureArrayEditor.DataType : TPictureDataType

Default: pftString

DataType is the type of data that the array editor will process.

The possible values and their corresponding Pascal data types are:

pftString	string

pftChar	Char

pftBoolean	Boolean

pftYesNo	Boolean

pftLongInt	LongInt

pftWord	Word

pftInteger	Integer

pftByte	Byte

pftShortInt	ShortInt

pftReal	Real

pftExtended	Extended

pftDouble	Double

pftSingle	Single

pftComp	Comp

pftDate	TOvcDate

pftDateSt	string

pftTime	TOvcTime


TOvcPictureArrayEditor.DecimalPlaces
DecimalPlaces property

property TOvcPictureArrayEditor.DecimalPlaces : Byte

Default: 0

DecimalPlaces is the number of decimal places to display in the edit cell.

Although this property remains active for all possible data types, DecimalPlaces has an effect only for floating point fields.


TOvcPictureArrayEditor.MaxLength
MaxLength property

property TOvcPictureArrayEditor.MaxLength : Word

Default: dependent on the array editor data type

MaxLength is the maximum number of characters that can be entered in the edit cell.

MaxLength determines the logical width (in characters) of the edit cell. This value does not alter the physical width of the array editor, but it limits the number of characters that are accepted by the edit cell. MaxLength cannot be set to a value less than the length of the string assigned to the PictureMask property. Values greater than the length of the PictureMask are allowed and imply that positions in the edit cell that don't have a corresponding mask character will use the last mask character specified in the PictureMask property.

Caution: When editing string arrays, MaxLength must be less than or equal to the maximum length of the array elements. If MaxLength is greater than the maximum length, no error is generated and a memory overwrite will occur.


TOvcPictureArrayEditor.PictureMask
PictureMask property

property TOvcPictureArrayEditor.PictureMask : TPictureFieldMask

Default: 'XXXXXXXXXX'

PictureMask defines which characters the field accepts and the character format.

This property defines the input and display mask used for the cell. The possible values are:

pmAnyChar	= 'X';	{allows any character}

pmForceUpper	= '!';	{allows any character, forces upper case}

pmForceLower	= 'L';	{allows any character, forces lower case}

pmForceMixed	= 'x';	{allows any character, forces mixed case}

pmAlpha	= 'a';	{allows alphas only}

pmUpperAlpha	= 'A';	{allows alphas only, forces upper case}

pmLowerAlpha	= 'l';	{allows alphas only, forces lower case}

pmPositive	= '9';	{allows numbers and spaces only}

pmWhole	= 'i';	{allows numbers, spaces, minus}

pmDecimal	= '#';	{allows numbers, spaces, minus, period}

pmScientific	= 'E';	{allows numbers, spaces, minus, period, 'e'}

pmHexadecimal	= 'K';	{allows 0-9 and A-F, forces upper case}

pmBinary	= 'b';	{allows 0-1, space}

pmTrueFalse	= 'B';	{allows T, t, F, f}

pmYesNo	= 'Y';	{allows Y, y, N, n}

The value assigned to PictureMask is not tested for validity. It is possible to assign a mask that is invalid.

You can directly enter a mask string in the PictureMask edit field in the Object Inspector or you can invoke the picture mask property editor to view and select from several example picture masks. Double click the PictureMask property value in the Object Inspector or select the dialog button to display the "Picture Mask" property editor.

When PictureMask is set, the MaxLength property is automatically set to reflect the length of the picture mask.

If PictureMask contains a literal decimal character, the value assigned to the DecimalPlaces property is ignored.

The following example sets the input mask for all array editor cells to allow entry of any character and force alpha characters to upper case. It also sets the MaxLength value to eight (the length of the picture mask).

PictureMask := '!!!!!!!!';


TOvcPictureArrayEditor.events
TOvcPictureArrayEditor events

OnChange	OnGetItemColor

OnClick	OnKeyDown

OnDblClick	OnKeyPress

OnDragDrop	OnKeyUp

OnDragOver	OnMouseDown

OnEndDrag	OnMouseMove

OnEnter	OnMouseUp

OnError	OnSelect

OnExit	OnUserCommand

OnGetItem	OnUserValidation


TOvcPictureArrayEditor.methods
TOvcPictureArrayEditor methods

AlignControls 	Hide

Assign	InheritsFrom

AssignTo 	InitInstance

BeginDrag	InsertComponent

BringToFront	InsertControl

Broadcast	InstanceSize

CanFocus	Invalidate

ChangeName 	IsControlMouseMsg

ChangeScale 	KeyDown

ClassInfo	KeyPress

ClassName	KeyUp

ClassParent	Loaded

ClassType	MainWndProc

Click 	MethodAddress

ClientToScreen	MethodName

ContainsControl	MouseDown

ControlAtPos	MouseMove

Create	MouseUp

CreateHandle 	NewInstance

CreateSubClass 	NotifyControls

CreateWindowHandle 	PaintControls

DblClick 	PaintHandler

DefaultHandler 	PaintWindow

Destroy	PaletteChanged

DestroyComponents	Perform

DestroyHandle 	ReadState

Destroying	Realign

DestroyWindowHandle 	RecreateWnd

DestroyWnd 	Refresh

DisableAlign	RemoveComponent

Dispatch	RemoveControl

DoEnter 	Repaint

DoExit 	ScaleBy

DoKeyDown 	ScaleControls

DoKeyPress 	ScreenToClient

DoKeyUp 	ScrollBy

DragCanceled 	SelectFirst

Dragging	SelectNext

EnableAlign	SendToBack

EndDrag	SetBounds

FieldAddress	SetDesigning

FindComponent	SetFocus

FindNextControl 	SetName

Focused	SetParent

Free	SetTextBuf

FreeInstance	SetZOrder

GetClientOrigin 	Show

GetClientRect 	ShowControl

GetDeviceContext 	Update

GetPalette 	UpdateBoundsRect

GetTabOrderList	ValidateRename

GetTextBuf	VisibleChanging

GetTextLen	WndProc

HandleAllocated	WriteComponents

HandleNeeded	WriteState

HasParent


TOvcPictureArrayEditor.properties
TOvcPictureArrayEditor properties

Align	HelpContext

AutoAdvanceChar	HighlightColors

AutoAdvanceLeftRight	Hint

BeepOnError	IsControl

BorderStyle	ItemIndex

BoundsRect 	Left

Brush 	MaxLength

Canvas  	MouseCapture

Caption  	Name

ClientHeight 	NumItems

ClientOrigin 	Owner

ClientRect 	Parent

ClientWidth 	ParentColor

Color	ParentCtl3D

ComponentCount 	ParentFont

ComponentIndex 	ParentShowHint

Components 	PictureMask

ComponentState 	PopupMenu

ControlCount 	RangeHi

Controller	RangeLo

Controls 	ReadOnly

ControlState 	RowHeight

ControlStyle 	ShowHint

Ctl3D	Showing

Cursor	TabOrder

DataType	TabStop

DecimalPlaces	Tag

DefWndProc  	Text

DesignInfo 	Top

DragCursor	UseScrollBar

DragMode	Visible

Enabled	Width

Font	WindowHandle

Handle

Height


TOvcPictureField
 TOvcPictureField component

See also: properties, events, methods, hierarchy

Component Overview

Picture entry fields differ from simple entry fields in that picture entry fields allow different mask characters for each character position in the field. For example, a social security number field could have a picture mask of '999-99-9999'. The hyphens are treated as literal characters, and cannot be changed during data entry. In the positions that contain '9', only digits or blanks can be entered. Picture entry fields are always padded to their maximum length with blanks.

Although the picture entry field differs from the simple entry field in the degree to which input can be validated on a character-by-character basis, in essence they both provide the same facilities for validation. They use the same process for validating data on a field-by-field basis.

Picture entry fields allow the same data types supported by simple entry fields, plus support for the date and time data types.


TOvcPictureField hierarchy


TOvcPictureField.DataType
DataType property

property TOvcPictureField.DataType : TPictureDataType

Default: pftString

DataType determines what type of information the picture entry field can edit.

The possible values and their corresponding Pascal data types are:

nftLongInt	LongInt

nftWord	Word

nftInteger	Integer

nftByte	Byte

nftShortInt	ShortInt

nftReal	Real

nftExtended	Extended

nftDouble	Double

nftSingle	Single

nftComp	Comp


TOvcPictureField.PictureMask
PictureMask property

property TOvcPictureField.PictureMask : string

Default: 'XXXXXXXXXXXXXXX'

PictureMask defines which characters the field accepts and the character format.

This property defines the input and display mask used for the picture entry field. The possible values are:

pmAnyChar	= 'X';	{allows any character}

pmForceUpper	= '!';	{allows any character, forces upper case}

pmForceLower	= 'L';	{allows any character, forces lower case}

pmForceMixed	= 'x';	{allows any character, forces mixed case}

pmAlpha	= 'a';	{allows alphas only}

pmUpperAlpha	= 'A';	{allows alphas only, forces upper case}

pmLowerAlpha	= 'l';	{allows alphas only, forces lower case}

pmPositive	= '9';	{allows numbers and spaces only}

pmWhole	= 'i';	{allows numbers, spaces, minus}

pmDecimal	= '#';	{allows numbers, spaces, minus, period}

pmScientific	= 'E';	{allows numbers, spaces, minus, period, 'e'}

pmHexadecimal	= 'K';	{allows 0-9 and A-F, forces upper case}

pmBinary	= 'b';	{allows 0-1, space}

pmTrueFalse	= 'B';	{allows T, t, F, f}

pmYesNo	= 'Y';	{allows Y, y, N, n}

The value assigned to PictureMask is not tested for validity. It is possible to assign a mask that is invalid.

You can directly enter a mask string in the PictureMask edit field in the Object Inspector or you can invoke the picture mask property editor to view and select from several example picture masks. Double click the PictureMask property value in the Object Inspector or select the dialog button to display the "Picture Mask" property editor.


TOvcPictureField.events
TOvcPictureField events

OnChange	OnKeyDown

OnClick	OnKeyPress

OnDblClick	OnKeyUp

OnDragDrop	OnMouseDown

OnDragOver	OnMouseMove

OnEndDrag	OnMouseUp

OnEnter	OnUserCommand

OnError	OnUserValidation

OnExit


TOvcPictureField.methods
TOvcPictureField methods

AlignControls 	InheritsFrom

Assign	InitInstance

AssignTo 	InsertComponent

BeginDrag	InsertControl

BringToFront	InstanceSize

Broadcast	Invalidate

CanFocus	IsControlMouseMsg

ChangeName 	IsValid

ChangeScale 	KeyDown

ClassInfo	KeyPress

ClassName	KeyUp

ClassParent	Loaded

ClassType	MainWndProc

ClearContents	MethodAddress

ClearSelection	MethodName

Click 	MouseDown

ClientToScreen	MouseMove

ContainsControl	MouseUp

ControlAtPos	MoveCaret

CopyToClipboard	NewInstance

Create	NotifyControls

CreateHandle 	PaintControls

CreateSubClass 	PaintHandler

CreateWindowHandle 	PaintWindow

CutToClipboard	PaletteChanged

DblClick 	PasteFromClipboard

DecreaseValue	Perform

DefaultHandler 	ReadState

Destroy	Realign

DestroyComponents	RecreateWnd

DestroyHandle 	Refresh

Destroying	RemoveComponent

DestroyWindowHandle 	RemoveControl

DestroyWnd 	Repaint

DisableAlign	Restore

Dispatch	ScaleBy

DoEnter 	ScaleControls

DoExit 	ScreenToClient

DoKeyDown 	ScrollBy

DoKeyPress 	SelectAll

DoKeyUp 	SelectFirst

DragCanceled 	SelectNext

Dragging	SendToBack

EnableAlign	SetBounds

EndDrag	SetDesigning

FieldAddress	SetFocus

FieldIsEmpty	SetInitialValue

FindComponent	SetParent

FindNextControl 	SetRangeHi

Focused	SetRangeLo

Free	SetSelection

FreeInstance	SetTextBuf

GetClientOrigin 	SetValue

GetClientRect 	SetZOrder

GetDeviceContext 	Show

GetPalette 	ShowControl

GetTabOrderList	Update

GetTextBuf	UpdateBoundsRect

GetTextLen	ValidateRename

GetValue	ValidateSelf

HandleAllocated	VisibleChanging

HandleNeeded	WndProc

HasParent 	WriteComponents

Hide	WriteState

IncreaseValue


TOvcPictureField.properties
TOvcPictureField properties

Align 	EverModified

AsBoolean 	Font

AsCents 	ForceInsert

AsDateTime 	ForceOvertype

AsExtended 	Handle

AsFloat 	Height

AsInteger 	HelpContext

AsOvcDate 	HighlightColors

AsOvcTime 	Hint

AsString 	InputRequired

AutoAdvanceChar	InsertPushes

AutoAdvanceLeftRight	IntlSupport

AutoAdvanceUpDown	IsControl

AutoSelect	LastError

AutoSize	Left

BeepOnError	MaxLength

BorderStyle	Modified

BoundsRect 	MouseCapture

Brush 	Name

Canvas  	Owner

Caption  	PadChar

CaretIns	Parent

CaretOvr	ParentColor

CaretToEnd	ParentCtl3D

ClientHeight 	ParentFont

ClientOrigin 	ParentShowHint

ClientRect 	PasswordChar

ClientWidth 	PasswordMode

Color	PictureMask

ComponentCount 	PopupMenu

ComponentIndex 	RangeHi

Components 	RangeLo

ComponentState 	ReadOnly

ControlCharColor	RightJustify

ControlCount 	SelectedText

Controller	SelectionLength

Controls 	SelectionStart

ControlState 	ShowHint

ControlStyle 	Showing

Ctl3D	SoftValidation

CurrentPos 	StripLiterals

Cursor	TabOrder

DataSize 	TabStop

DataType	Tag

DecimalPlaces 	Text

DefWndProc  	Top

DesignInfo 	TrimBlanks

DisplayString 	Uninitialized

DragCursor	UserData

DragMode	Visible

EditString 	Width

Enabled	WindowHandle

ErrorColors


TOvcRotatedLabel
 TOvcRotatedLabel component

See also: properties, events, methods, hierarchy

Component Overview

The rotated label component is similar to the standard Delphi TLabel component, but allows you to display text on a form at any angle and size using a TrueType font.

Only TrueType fonts can be rotated, so if you select a non-TrueType font, the FontAngle is forced to 0.


TOvcRotatedLabel hierarchy


TOvcRotatedLabel.FontAngle
FontAngle property

property TOvcRotatedLabel.FontAngle : Integer

Default: 0

FontAngle is the number of degrees that the font is rotated.

Positive values (0 through 360) rotate the font counter-clockwise. Negative values (0 through -360) rotate the font clockwise.

Values outside the range of -360 through 360 are automatically converted to values in the valid range.


TOvcRotatedLabel.OriginX
OriginX property

property TOvcRotatedLabel.OriginX : Integer

Default: 0

OriginX determines the position of the first character from the left side of the rotated label.

OriginX is the pixel offset of the first character and is relative to the left side of the client area.

See also: OriginY


TOvcRotatedLabel.OriginY
OriginY property

property TOvcRotatedLabel.OriginY : Integer

Default: 0

OriginY determines the position of the first character from the top edge of the rotated label.

OriginY is the pixel offset of the first character and is relative to the top edge of the client area.

See also: OriginX


TOvcRotatedLabel.Transparent
Transparent property

property TOvcRotatedLabel.Transparent : Boolean

Transparent determines whether the label hides items beneath it.

If the Transparent property is True and the rotated label overlaps another component on the form, the component covered by the rotated label is still visible. If the Transparent property is False, other components overlapped by the rotated label are hidden.


TOvcRotatedLabel.events
TOvcRotatedLabel events

OnClick	OnEndDrag

OnDblClick	OnMouseDown

OnDragDrop	OnMouseMove

OnDragOver	OnMouseUp


TOvcRotatedLabel.methods
TOvcRotatedLabel methods

Assign	InheritsFrom

AssignTo 	InitInstance

BeginDrag	InsertComponent

BringToFront	InstanceSize

ChangeName 	Invalidate

ChangeScale 	Loaded

ClassInfo	MethodAddress

ClassName	MethodName

ClassParent	MouseDown

ClassType	MouseMove

Click 	MouseUp

ClientToScreen	NewInstance

Create	Notification

DblClick 	PaletteChanged

DefaultHandler 	Perform

DefineProperties 	ReadState

Destroy	Refresh

DestroyComponents	RemoveComponent

Destroying	Repaint

Dispatch	ScreenToClient

DragCanceled 	SendToBack

Dragging	SetBounds

EndDrag	SetDesigning

FieldAddress	SetName

FindComponent	SetParent

Free	SetTextBuf

FreeInstance	SetZOrder

GetClientOrigin 	Show

GetClientRect 	Update

GetDeviceContext 	UpdateBoundsRect

GetPalette 	ValidateRename

GetTextBuf	VisibleChanging

GetTextLen	WndProc

HasParent 	WriteComponents

Hide	WriteState


TOvcRotatedLabel.properties
TOvcRotatedLabel properties

Align	Height

BoundsRect 	Hint

Canvas  	IsControl

Caption	Left

ClientHeight 	MouseCapture

ClientOrigin 	Name

ClientRect 	OriginX

ClientWidth 	OriginY

Color	Owner

ComponentCount 	Parent

ComponentIndex 	ParentColor

Components 	ParentFont

ComponentState 	ParentShowHint

ControlState 	PopupMenu

ControlStyle 	ShowHint

Cursor	Tag

DesignInfo 	Text

DragCursor	Top

DragMode	Transparent

Enabled	Visible

Font	Width

FontAngle


TOvcSimpleArrayEditor
 TOvcSimpleArrayEditor component

See also: properties, events, methods, hierarchy

Component Overview

The TOvcSimpleArrayEditor component is derived from a TOvcBaseArrayEditor. The TOvcSimpleArrayEditor edit cells are just TOvcSimpleFields. The PictureMask, MaxLength, and DecimalPlaces properties behave just like the TOvcSimpleField properties of the same name.


TOvcSimpleArrayEditor hierarchy


TOvcSimpleArrayEditor.DataType
DataType property

property TOvcSimpleArrayEditor.DataType : TSimpleDataType

Default: sftString

DataType is the type of data that the array editor will process.

The possible values and their corresponding Pascal data types are:

sftString	string

sftChar	Char

sftBoolean	Boolean

sftYesNo	Boolean

sftLongInt	LongInt

sftWord	Word

sftInteger	Integer

sftByte	Byte

sftShortInt	ShortInt

sftReal	Real

sftExtended	Extended

sftDouble	Double

sftSingle	Single

sftComp	Comp


TOvcSimpleArrayEditor.DecimalPlaces
DecimalPlaces property

property TOvcSimpleArrayEditor.DecimalPlaces : Byte

Default: 0

DecimalPlaces is the number of decimal places to display in the edit cell.

Although this property remains active for all possible data types, DecimalPlaces has an effect only for floating point fields.


TOvcSimpleArrayEditor.MaxLength
MaxLength property

property TOvcSimpleArrayEditor.MaxLength : Word

Default: dependent on the array editor data type

MaxLength is the maximum number of characters that can be entered in the edit cell.

MaxLength determines the logical width (in characters) of the edit cell. This value does not alter the physical width of the array editor. It limits the number of characters that are accepted by the edit cell.

Caution: When editing string arrays, MaxLength must be less than or equal to the maximum length of the array elements. If MaxLength is greater than the maximum length, no error is generated and a memory overwrite will occur.


TOvcSimpleArrayEditor.PictureMask
PictureMask property

property TOvcSimpleArrayEditor.PictureMask : TSimpleFieldMask

Default: pmAnyChar

PictureMask defines which characters the cell accepts and the character format.

This property defines the input and display mask used for the cell. The possible values are:

pmAnyChar	= 'X';	{allows any character}

pmForceUpper	= '!';	{allows any character, forces upper case}

pmForceLower	= 'L';	{allows any character, forces lower case}

pmForceMixed	= 'x';	{allows any character, forces mixed case}

pmAlpha	= 'a';	{allows alphas only}

pmUpperAlpha	= 'A';	{allows alphas only, forces upper case}

pmLowerAlpha	= 'l';	{allows alphas only, forces lower case}

pmPositive	= '9';	{allows numbers and spaces only}

pmWhole	= 'i';	{allows numbers, spaces, minus}

pmDecimal	= '#';	{allows numbers, spaces, minus, period}

pmScientific	= 'E';	{allows numbers, spaces, minus, period, 'e'}

pmHexadecimal	= 'K';	{allows 0-9 and A-F, forces upper case}

pmBinary	= 'b';	{allows 0-1, space}

pmTrueFalse	= 'B';	{allows T, t, F, f}

pmYesNo	= 'Y';	{allows Y, y, N, n}

The value assigned to PictureMask is tested only against the list shown above. It is still possible to assign a character that is inappropriate because of the cell's data type. For example, if the cell has a data type of sftReal, setting the PictureMask property to 'A' is allowed but is invalid because it allows only alphabetic characters.

You can directly enter a mask character in the PictureMask edit field in the Object Inspector or you can invoke the picture mask property editor to view and select from a list of the picture mask characters. Double click on the PictureMask property value or select the dialog button to display the "Simple Mask" property editor.


TOvcSimpleArrayEditor.events
TOvcSimpleArrayEditor events

OnChange	OnGetItemColor

OnClick	OnKeyDown

OnDblClick	OnKeyPress

OnDragDrop	OnKeyUp

OnDragOver	OnMouseDown

OnEndDrag	OnMouseMove

OnEnter	OnMouseUp

OnError	OnSelect

OnExit	OnUserCommand

OnGetItem	OnUserValidation


TOvcSimpleArrayEditor.methods
TOvcSimpleArrayEditor methods

AlignControls 	Hide

Assign	InheritsFrom

AssignTo 	InitInstance

BeginDrag	InsertComponent

BringToFront	InsertControl

Broadcast	InstanceSize

CanFocus	Invalidate

ChangeName 	IsControlMouseMsg

ChangeScale 	KeyDown

ClassInfo	KeyPress

ClassName	KeyUp

ClassParent	Loaded

ClassType	MainWndProc

Click 	MethodAddress

ClientToScreen	MethodName

ContainsControl	MouseDown

ControlAtPos	MouseMove

Create	MouseUp

CreateHandle 	NewInstance

CreateSubClass 	NotifyControls

CreateWindowHandle 	PaintControls

DblClick 	PaintHandler

DefaultHandler 	PaintWindow

Destroy	PaletteChanged

DestroyComponents	Perform

DestroyHandle 	ReadState

Destroying	Realign

DestroyWindowHandle 	RecreateWnd

DestroyWnd 	Refresh

DisableAlign	RemoveComponent

Dispatch	RemoveControl

DoEnter 	Repaint

DoExit 	ScaleBy

DoKeyDown 	ScaleControls

DoKeyPress 	ScreenToClient

DoKeyUp 	ScrollBy

DragCanceled 	SelectFirst

Dragging	SelectNext

EnableAlign	SendToBack

EndDrag	SetBounds

FieldAddress	SetDesigning

FindComponent	SetFocus

FindNextControl 	SetName

Focused	SetParent

Free	SetTextBuf

FreeInstance	SetZOrder

GetClientOrigin 	Show

GetClientRect 	ShowControl

GetDeviceContext 	Update

GetPalette 	UpdateBoundsRect

GetTabOrderList	ValidateRename

GetTextBuf	VisibleChanging

GetTextLen	WndProc

HandleAllocated	WriteComponents

HandleNeeded	WriteState

HasParent


TOvcSimpleArrayEditor.properties
TOvcSimpleArrayEditor properties

Align	HelpContext

AutoAdvanceChar	HighlightColors

AutoAdvanceLeftRight	Hint

BeepOnError	IsControl

BorderStyle	ItemIndex

BoundsRect 	Left

Brush 	MaxLength

Canvas  	MouseCapture

Caption  	Name

ClientHeight 	NumItems

ClientOrigin 	Owner

ClientRect 	Parent

ClientWidth 	ParentColor

Color	ParentCtl3D

ComponentCount 	ParentFont

ComponentIndex 	ParentShowHint

Components 	PictureMask

ComponentState 	PopupMenu

ControlCount 	RangeHi

Controller	RangeLo

Controls 	ReadOnly

ControlState 	RowHeight

ControlStyle 	ShowHint

Ctl3D	Showing

Cursor	TabOrder

DataType	TabStop

DecimalPlaces	Tag

DefWndProc  	Text

DesignInfo 	Top

DragCursor	UseScrollBar

DragMode	Visible

Enabled	Width

Font	WindowHandle

Handle

Height


TOvcSimpleField
 TOvcSimpleField component

See also: properties, events, methods, hierarchy

Component Overview

The Orpheus simple entry field component is similar to the Windows standard edit control and the standard Delphi TEdit component. The default editing and caret movement commands are basically the same. The differences are the additional features that the Orpheus simple entry field provides. It supports input validation on both a character-by-character and field-by-field basis. Additionally, the simple entry field has the unique ability to respond to alternate keyboard commands, such as WordStar-style commands or even user-defined commands. See the TOvcCommandProcessor class help topics for information on how to create and install user-defined commands and command tables.

The simple entry field is limited to a single line and a single character picture mask. The mask character indicates the set of characters that are allowed. For example, a simple Word field might have a mask character of '9', which allows digits and blanks only, and a maximum length of 5. A simple string field might have a mask character of 'X', which allows any character, and a maximum length of 255.


TOvcSimpleField hierarchy


TOvcSimpleField.DataType
DataType property

property TOvcSimpleField.DataType : TSimpleDataType

Default: sftString

DataType determines what type of information the simple entry field can edit.

The possible values and their corresponding Pascal data types are:

sftString	string

sftChar	Char

sftBoolean	Boolean

sftYesNo	Boolean

sftLongInt	LongInt

sftWord	Word

sftInteger	Integer

sftByte	Byte

sftShortInt	ShortInt

sftReal	Real

sftExtended	Extended

sftDouble	Double

sftSingle	Single

sftComp	Comp


TOvcSimpleField.PictureMask
PictureMask property

property TOvcSimpleField.PictureMask : Char

Default: pmAnyChar ('X')

PictureMask defines which characters the field accepts and the character format.

This property defines the input and display mask used for the entry field. The possible values are:

pmAnyChar	= 'X';	{allows any character}

pmForceUpper	= '!';	{allows any character, forces upper case}

pmForceLower	= 'L';	{allows any character, forces lower case}

pmForceMixed	= 'x';	{allows any character, forces mixed case}

pmAlpha	= 'a';	{allows alphas only}

pmUpperAlpha	= 'A';	{allows alphas only, forces upper case}

pmLowerAlpha	= 'l';	{allows alphas only, forces lower case}

pmPositive	= '9';	{allows numbers and spaces only}

pmWhole	= 'i';	{allows numbers, spaces, minus}

pmDecimal	= '#';	{allows numbers, spaces, minus, period}

pmScientific	= 'E';	{allows numbers, spaces, minus, period, 'e'}

pmHexadecimal	= 'K';	{allows 0-9 and A-F, forces upper case}

pmBinary	= 'b';	{allows 0-1, space}

pmTrueFalse	= 'B';	{allows T, t, F, f}

pmYesNo	= 'Y';	{allows Y, y, N, n}

The value assigned to PictureMask is tested only against the list shown above. It is still possible to assign a character that is inappropriate because of the field's data type. For example, if the field has a data type of sftReal, setting the PictureMask property to 'A' is allowed but is invalid because it allows only alphabetic characters.

You can directly enter a mask character in the PictureMask edit field in the Object Inspector or you can invoke the picture mask property editor to view and select from a list of the picture mask characters. Double click on the PictureMask property value or select the dialog button to display the "Simple Mask" property editor.


TOvcSimpleField.events
TOvcSimpleField events

OnChange	OnKeyDown

OnClick	OnKeyPress

OnDblClick	OnKeyUp

OnDragDrop	OnMouseDown

OnDragOver	OnMouseMove

OnEndDrag	OnMouseUp

OnEnter	OnUserCommand

OnError	OnUserValidation

OnExit


TOvcSimpleField.methods
TOvcSimpleField methods

AlignControls 	InheritsFrom

Assign	InitInstance

AssignTo 	InsertComponent

BeginDrag	InsertControl

BringToFront	InstanceSize

Broadcast	Invalidate

CanFocus	IsControlMouseMsg

ChangeName 	IsValid

ChangeScale 	KeyDown

ClassInfo	KeyPress

ClassName	KeyUp

ClassParent	Loaded

ClassType	MainWndProc

ClearContents	MergeWithPicture

ClearSelection	MethodAddress

Click 	MethodName

ClientToScreen	MouseDown

ContainsControl	MouseMove

ControlAtPos	MouseUp

CopyToClipboard	MoveCaret

Create	NewInstance

CreateHandle 	NotifyControls

CreateSubClass 	PaintControls

CreateWindowHandle 	PaintHandler

CutToClipboard	PaintWindow

DblClick 	PaletteChanged

DecreaseValue	PasteFromClipboard

DefaultHandler 	Perform

Destroy	ReadState

DestroyComponents	Realign

DestroyHandle 	RecreateWnd

Destroying	Refresh

DestroyWindowHandle 	RemoveComponent

DestroyWnd 	RemoveControl

DisableAlign	Repaint

Dispatch	Restore

DoEnter 	ScaleBy

DoExit 	ScaleControls

DoKeyDown 	ScreenToClient

DoKeyPress 	ScrollBy

DoKeyUp 	SelectAll

DragCanceled 	SelectFirst

Dragging	SelectNext

EnableAlign	SendToBack

EndDrag	SetBounds

FieldAddress	SetDesigning

FieldIsEmpty	SetFocus

FindComponent	SetInitialValue

FindNextControl 	SetParent

Focused	SetRangeHi

Free	SetRangeLo

FreeInstance	SetSelection

GetClientOrigin 	SetTextBuf

GetClientRect 	SetValue

GetDeviceContext 	SetZOrder

GetPalette 	Show

GetStrippedEditString	ShowControl

GetTabOrderList	Update

GetTextBuf	UpdateBoundsRect

GetTextLen	ValidateRename

GetValue	ValidateSelf

HandleAllocated	VisibleChanging

HandleNeeded	WndProc

HasParent 	WriteComponents

Hide	WriteState

IncreaseValue


TOvcSimpleField.properties
TOvcSimpleField properties

Align 	EverModified

AsBoolean 	Font

AsCents 	ForceInsert

AsDateTime 	ForceOvertype

AsExtended 	Handle

AsFloat 	Height

AsInteger 	HelpContext

AsOvcDate 	HighlightColors

AsOvcTime 	Hint

AsString 	InputRequired

AutoAdvanceChar	InsertPushes

AutoAdvanceLeftRight	IntlSupport

AutoAdvanceUpDown	IsControl

AutoSelect	LastError

AutoSize	Left

BeepOnError	MaxLength

BorderStyle	Modified

BoundsRect 	MouseCapture

Brush 	Name

Canvas  	Owner

Caption  	PadChar

CaretIns	Parent

CaretOvr	ParentColor

CaretToEnd	ParentCtl3D

ClientHeight 	ParentFont

ClientOrigin 	ParentShowHint

ClientRect 	PasswordChar

ClientWidth 	PasswordMode

Color	PictureMask

ComponentCount 	PopupMenu

ComponentIndex 	RangeHi

Components 	RangeLo

ComponentState 	ReadOnly

ControlCharColor	RightJustify

ControlCount 	SelectedText

Controller	SelectionLength

Controls 	SelectionStart

ControlState 	ShowHint

ControlStyle 	Showing

Ctl3D	SoftValidation

CurrentPos 	StripLiterals

Cursor	TabOrder

DataSize 	TabStop

DataType	Tag

DecimalPlaces	Text

DefWndProc  	Top

DesignInfo 	TrimBlanks

DisplayString 	Uninitialized

DragCursor	UserData

DragMode	Visible

EditString 	Width

Enabled	WindowHandle

ErrorColors


TOvcSparseArray
TOvcSparseArray class

See also: properties, methods, hierarchy

Class Overview

The TOvcSparseArray class is a one-dimensional sparse array implementation. A sparse array is an array where only the "used" elements have memory allocated to them. Unused elements are assumed to be empty and no memory is allocated to them. For example, if you declare an array of 1000 integer elements in a 16-bit Delphi program, 2000 bytes of memory are allocated (in 32-bit Delphi that will be 4000 bytes of memory). If you use only the 789th element, you waste a lot of memory.

The TOvcSparseArray class mimics the Delphi TList class, but is not descended from it. It uses many of the names of the TList methods. Like TList, it stores pointers only. Because unused elements in the sparse array are assumed to be nil, you must be careful if you store typecast long integers in a sparse array. Due to its internal structures and assumptions, TOvcSparseArray has a maximum limit of 320,000 pointers (this is defined as a constant called MaxSparseArrayItems in the OvcSpAry unit).

The TOvcSparseArray is used extensively by the Orpheus table for storing information about rows and individual cells. For individual cells, a sparse matrix (a sparse array of sparse arrays) is used.

TOvcSparseArray is not a data container that owns its data. The sparse array does not dispose its elements or call their destructors (if they have one). To do this, you must write a wrapper class that contains a sparse array. See the implementation of TOvcTableRows in the source code for an example.


TOvcSparseArray hierarchy


TOvcSparseArray.ActiveCount
ActiveCount run-time read-only property

property TOvcSparseArray.ActiveCount : LongInt

ActiveCount is the number of non-nil elements in the sparse array.

ActiveCount is a measure of how populated the sparse array is. For example, if a sparse array has only one non-nil element at index 999, then ActiveCount is 1 and Count is 1000.

ActiveCount is implemented as a call to ForAll.

ActiveCount is a read-only property. It changes when you Add, Delete, or Insert items in the sparse array (or use the Items array property).

See also: Count, ForAll


TOvcSparseArray.Add
Add method

function TOvcSparseArray.Add(Item : Pointer) : LongInt;

Add an element to the end of the sparse array.

Item is added to the sparse array and the new item pointer is placed at index Count. Add returns the index of the added item.

If the array is at its maximum size already (MaxSparseArrayItems), an ESAEAtMaxSize exception is raised.

See also: Insert


TOvcSparseArray.Clear
Clear method

procedure TOvcSparseArray.Clear;

Clear the sparse array.

After this call, both ActiveCount and Count are zero. Element pointers are not disposed of by this routine. You must dispose of the data.

See also: ActiveCount, Count


TOvcSparseArray.Count
Count run-time read-only property

property TOvcSparseArray.Count : LongInt

Count is the nominal number of elements in the sparse array.

Count is equal to one more than IndexOf(Last). It is the theoretical number of elements in the array. For example, if a sparse array has one non-nil element at index 999, then Count is 1000 (elements 0..998 are assumed to be there but empty).

Count is a read-only property. It changes when you Add, Delete, or Insert items in the sparse array (or use the Items array property). Reading Count is resolved by the Delphi compiler to accessing a field; no calculations are made.

See also: ActiveCount, IndexOf, Last


TOvcSparseArray.Create
Create constructor

constructor TOvcSparseArray.Create;

Create a sparse array.

Create allocates the internal structures for the sparse array, and sets the internal variables so that Count and ActiveCount return zero. The constructor initially allocates 40 bytes.

See also: Destroy


TOvcSparseArray.Delete
Delete method

procedure TOvcSparseArray.Delete(Index : LongInt);

Delete an element from the sparse array.

The element at Index is deleted from the sparse array. All of the elements with larger indexes have their indexes decremented.

If Index is less than 0 or greater than the maximum number of elements in the sparse array (MaxSparseArrayItems), an ESAEOutOfBounds exception is raised. If Index is greater than or equal to Count, nothing is done.

The data pointed to by the element is not disposed.

See also: Clear, Count


TOvcSparseArray.Destroy
Destroy destructor

destructor TOvcSparseArray.Destroy; override;

Destroy disposes of a sparse array.

Destroy calls the Clear method to clear the sparse array and then disposes of all the internal structures allocated for the sparse array. Data objects in the array are not disposed by this destructor.

See also: Create


TOvcSparseArray.Exchange
Exchange method

procedure TOvcSparseArray.Exchange(Index1, Index2 : LongInt);

Exchange switches the locations of two sparse array elements.

If Index1 or Index2 is less than 0 or greater than the maximum number of elements in a sparse array (MaxSparseArrayItems), an ESAEOutOfBounds exception is raised.


TOvcSparseArray.First
First method

function TOvcSparseArray.First : Pointer;

First returns the first non-nil pointer in the sparse array.

If the array has no non-nil elements (ActiveCount is zero), First returns nil.

First is implemented as a call to ForAll.

See also: ActiveCount, ForAll, Last


TOvcSparseArray.ForAll
ForAll method

function TOvcSparseArray.ForAll(Action : TSparseArrayFunc; Backwards : Boolean; ExtraData : Pointer) : LongInt;

TSparseArrayFunc = function(Index : LongInt; Item : Pointer; ExtraData : Pointer) : Boolean;

ForAll iterates through all the active elements in the sparse array.

Action is the routine that is called for each active (i.e., non-nil) element in the sparse array. It must be of type TSparseArrayFunc and declared far. Index is the index in the array. Item is the pointer itself. ExtraData is a pointer to a user-defined structure that you pass to ForAll. The Action function returns True if the ForAll iteration should continue and False if ForAll should return immediately.

Pass True for Backwards to iterate through the array backwards (from the highest index to the lowest index).

ExtraData is a pointer to a user-defined structure. ForAll passes this pointer unchanged to the Action routine. You can use it to declare any common data that must be used in the iteration and use it in the iterator routine.

ForAll is a function that returns the index of the element that caused the Action routine to return False. If no call to Action returned False, ForAll returns -1.

The combination of ForAll and your Action routine can perform traditional "for each element" processing (Action should always return True), find the first element that satisfies a condition (Action should return False if it finds the element that satisfies the condition), or find the last element that satisfies a condition (set Backwards to True).


TOvcSparseArray.IndexOf
IndexOf method

function TOvcSparseArray.IndexOf(Item : Pointer) : LongInt;

IndexOf returns the index of the specified item.

IndexOf iterates sequentially through the array looking for an element that is equal to the Item pointer. If an element is found, IndexOf returns that index number, otherwise it returns -1.

IndexOf is implemented as a call to ForAll.

See also: ForAll


TOvcSparseArray.Insert
Insert method

procedure TOvcSparseArray.Insert(Index : LongInt; Item : Pointer);

Insert a new element at the specified position in the sparse array.

The Item pointer is inserted at Index and the elements from Index on have their indexes incremented.

If Index is less than 0 or greater than the maximum number of elements in the sparse array (MaxSparseArrayItems), an ESAEOutOfBounds exception is raised. If the array is at its maximum size already, an ESAEAtMaxSize exception is raised.

See also: Add, Delete


TOvcSparseArray.Items
Items run-time property

property TOvcSparseArray.Items[Index : LongInt] : Pointer

Items is the array of elements in the sparse array.

Items is the "front-end" to the sparse array. It maps an ordinary array onto the sparse array so that reading an element either returns the element pointer from the sparse array, or nil if the element is not present. Writing a pointer to the Items array will cause the sparse array to store the new pointer.

To remove an item from the array, set it to nil. This could cause the sparse array to call Squeeze to minimize the amount of heap space used.

If Index is less than 0 or greater than the maximum number of elements in the sparse array (MaxSparseArrayItems), an ESAEOutOfBounds exception is raised.

See also: Squeeze


TOvcSparseArray.Last
Last method

function TOvcSparseArray.Last : Pointer;

Last returns the last non-nil pointer in the sparse array.

If the array has no non-nil elements (ActiveCount is zero), Last returns nil.

Last is implemented as a call to ForAll.

See also: ActiveCount, First, ForAll


TOvcSparseArray.Squeeze
Squeeze method

procedure TOvcSparseArray.Squeeze;

Squeeze minimizes the amount of memory used by the sparse array.

After inserts and deletes are made in a sparse array, it might be using more memory than it needs (due to the internal algorithm used). Squeeze removes the unused memory, returning it to the heap.

Delete calls Squeeze automatically, but Insert does not. Writing to the Items array property causes Squeeze to be called under certain circumstances. Therefore you should not need to call Squeeze manually.

See also: Delete, Insert, Items


TOvcSparseArray.methods
TOvcSparseArray methods

Add	ForAll

ClassInfo	Free

ClassName	FreeInstance

ClassParent	IndexOf

ClassType	InheritsFrom

Clear	InitInstance

Create	Insert

DefaultHandler	InstanceSize

Delete	Last

Destroy	MethodAddress

Dispatch	MethodName

Exchange	NewInstance

FieldAddress	Squeeze

First


TOvcSparseArray.properties
TOvcSparseArray properties

ActiveCount 	Items

Count


TOvcSpinner
 TOvcSpinner component

See also: properties, events, methods, hierarchy

Component Overview

The TOvcSpinner is the simplest of the Orpheus spin components. Its spin buttons look just like the component icon shown on the component palette. It allows you to offer an alternative to normal data entry by allowing the user to adjust a field value by clicking on one of the two spin buttons. The up arrow usually increases the field value, and the down arrow decreases it.

To use a spin component, you provide an OnClick event handler that responds to the user clicking on either of the spin buttons. However, if a TOvcSpinner has its FocusedControl property set to one of the Orpheus entry field components, you do not need to write an event handler. The spin component is "aware" of Orpheus entry fields and directly calls the necessary methods to increase and decrease field values for entry fields editing any of the numeric, date, or time data types.


TOvcSpinner hierarchy


TOvcStarSpinner
 TOvcStarSpinner component

See also: properties, events, methods, hierarchy

Component Overview

TOvcStarSpinner is very similar to TOvcSpinner and TOvcFourWaySpinner, except that it adds a center button. Its spin buttons look just like the component icon shown on the component palette. The center button is like a standard TButton in that it does not generate multiple notifications if it is held down. The center button can be used to trigger almost any task.

For example, when a TOvcStarSpinner is attached to a date picture field, the center button can be used to trigger a calendar display corresponding to the date in the field. The left and right spin buttons move the caret among the day, month, and year subfields and the up and down spin buttons increase and decrease the current subfield. The center button is used to display a calendar from which a date can be selected.

To use a spin component, you provide an OnClick event handler that responds to the user clicking on the spin buttons. However, if a TOvcStarSpinner has its FocusedControl property set to one of the Orpheus entry field components, you do not need to write an event handler. The spin component is "aware" of Orpheus entry fields and directly calls the necessary methods to increase and decrease field values for entry fields editing any of the numeric, date, or time data types.


TOvcStarSpinner hierarchy


TOvcStarSpinner.DrawStarBorder
DrawStarBorder property

property TOvcStarSpinner.DrawStarBorder : Boolean

Default: False

DrawStarBorder determines whether a border is drawn around the star spinner.

If the star spinner is small, a border produces an undesirable effect. DrawStarBorder is most useful when the height and width of the star are greater than 100 pixels and the ForceSquare property is True.

See also: ForceSquare


TOvcStarSpinner.ForceSquare
ForceSquare property

property TOvcStarSpinner.ForceSquare : Boolean

Default: False

ForceSquare determines whether the height and width of the star spinner are forced to be equal.

If ForceSquare is True, adjustments to the size of the star spinner are monitored and possibly modified to ensure that the height and width are equal. If adjustments are needed, the smaller of the height or width is used.


TOvcStarSpinner.events
TOvcStarSpinner events

OnClick	OnKeyDown

OnDblClick 	OnKeyPress

OnDragDrop 	OnKeyUp

OnDragOver 	OnMouseDown

OnEndDrag 	OnMouseMove

OnEnter 	OnMouseUp

OnExit


TOvcStarSpinner.methods
TOvcStarSpinner methods

AlignControls 	HasParent

Assign	Hide

AssignTo 	InheritsFrom

BeginDrag	InitInstance

BringToFront	InsertComponent

Broadcast	InsertControl

CanFocus	InstanceSize

ChangeName 	Invalidate

ChangeScale 	IsControlMouseMsg

ClassInfo	KeyDown

ClassName	KeyPress

ClassParent	KeyUp

ClassType	Loaded

Click 	MainWndProc

ClientToScreen	MethodAddress

ContainsControl	MethodName

ControlAtPos	MouseDown

Create	MouseMove

CreateHandle 	MouseUp

CreateSubClass 	NewInstance

CreateWindowHandle 	NotifyControls

DblClick 	PaintControls

DefaultHandler 	PaintHandler

DefineProperties 	PaintWindow

Destroy	PaletteChanged

DestroyComponents	Perform

DestroyHandle 	ReadState

Destroying	Realign

DestroyWindowHandle 	RecreateWnd

DestroyWnd 	Refresh

DisableAlign	RemoveComponent

Dispatch	RemoveControl

DoEnter 	Repaint

DoExit 	ScaleBy

DoKeyDown 	ScaleControls

DoKeyPress 	ScreenToClient

DoKeyUp 	ScrollBy

DragCanceled 	SelectFirst

Dragging	SelectNext

EnableAlign	SendToBack

EndDrag	SetDesigning

FieldAddress	SetFocus

FindComponent	SetName

FindNextControl 	SetParent

Focused	SetTextBuf

Free	SetZOrder

FreeInstance	Show

GetClientOrigin 	ShowControl

GetClientRect 	Update

GetDeviceContext 	UpdateBoundsRect

GetPalette 	ValidateRename

GetTabOrderList	VisibleChanging

GetTextBuf	WndProc

GetTextLen	WriteComponents

HandleAllocated	WriteState

HandleNeeded


TOvcStarSpinner.properties
TOvcStarSpinner properties

Acceleration	Font

Align 	ForceOddSize

AutoRepeat	ForceSquare

BoundsRect 	Handle

Brush 	Height

Canvas  	HelpContext

Caption  	Hint

ClientHeight 	IsControl

ClientOrigin 	Left

ClientRect 	MouseCapture

ClientWidth 	Name

Color  	Owner

ComponentCount 	Parent

ComponentIndex 	ParentColor

Components 	ParentCtl3D

ComponentState 	ParentFont

ControlCount 	ParentShowHint

Controller  	PopupMenu

Controls 	ShowHint

ControlState 	Showing

ControlStyle 	TabOrder

Ctl3D  	TabStop

Cursor	Tag

DefWndProc  	Text

Delta	Top

DesignInfo 	Visible

DragCursor  	Width

DragMode  	WindowHandle

DrawStarBorder	WrapMode

Enabled

FocusedControl


TOvcTCBaseBitMap
TOvcTCBaseBitMap class

See also: properties, methods, hierarchy

Class Overview

The TOvcTCBaseBitMap class is the ancestor for all cell classes that display bitmaps.

The only overridden method is the Paint method. The data pointer passed to Paint refers to a record structure containing the bitmap to be displayed, the index of the glyph to display, a count of the number of glyphs (square subdivisions of the bitmap), and a count of the number of active glyphs that can be displayed. Descendants must initialize this data record and call the Paint method for this class to do the actual painting of the glyph (if there is only one glyph, this equates to the whole bitmap). For example, the checkbox cell component uses a bitmap with three glyphs (unchecked, checked and grayed), and sometimes only two of these glyphs are used.

This class is designed as an abstract class, so you should not create any instances of it.


TOvcTCBaseBitMap hierarchy


TOvcTCBaseBitMap.Paint
Paint method

procedure TOvcTCBaseBitMap.Paint(Canvas : TCanvas; RowNum : TRowNum; ColNum : TColNum; CellWidth, CellHeight : Integer; const CellAttr : TOvcCellAttributes; Data : Pointer); override;

Paint the bitmap in the cell in the table.

Canvas is where the cell should be painted. RowNum and ColNum are the row and column numbers of the cell being painted. CellAttr is a fully resolved set of attributes for the current cell.

PCellBitMapInfo = ^TCellBitMapInfo;

TCellBitMapInfo = record

  BM          : TBitMap;    {bitmap object to display}

  Count       : Integer;    {number of glyphs}

  ActiveCount : Integer;    {number of active glyphs}

  Index       : Integer;    {index of glyph to display}

end;

Data is a pointer to a data structure of type TCellBitMapInfo. The BM field is the bitmap that will be displayed (or rather, the bitmap of which part will be displayed). Count is the number of glyphs or subdivisions of the bitmap; if the bitmap is a single entity this value is one. ActiveCount is the number of bitmaps that will be cycled through on editing. If the bitmap is a single entity this value is one. Index is the zero-based number of the glyph to display.

For example, the checkbox cell component is derived from this class. It uses a bitmap of 3 glyphs (Count is 3), and only uses 2 of those if its AllowGrayed property is False (Active Count is 2). Setting Index to 0 displays the first glyph (the unchecked glyph); setting Index to 1 displays the second glyph (the checked glyph).

Paint calls the ancestor's Paint method to blank the cell rectangle. If CellAttr.caAccess is not otxInvisible, it then paints the relevant glyph on the canvas in the position indicated by CellAttr.Adjust. The glyph is not stretched to fit in the cell. The TCanvas.BrushCopy method is used to paint the glyph. This means that the glyphs can use the transparent color feature used by Delphi's TSpeedbuttons if the bottom left pixel of the glyph is the transparent color. For more details on this feature, please see the Delphi documentation.


TOvcTCBaseBitMap.methods
TOvcTCBaseBitMap methods

Assign	HasParent

AssignTo 	IncRefs

CanStopEditing	InheritsFrom

ChangeName 	InitInstance

ClassInfo	InsertComponent

ClassName	InstanceSize

ClassParent	Loaded

ClassType	MethodAddress

Create	MethodName

DecRefs	NewInstance

DefaultHandler	Notification

DefineProperties 	Paint

Destroy	ReadState

DestroyComponents	RemoveComponent

Destroying	ResolveAttributes

Dispatch	SendKeyToTable

EditHandle	SetDesigning

EditHide	SetName

EditMove	StartEditing

FieldAddress	StopEditing

FilterTableKey	TableWantsTab

FindComponent	ValidateRename

Free	WriteComponents

FreeInstance	WriteState


TOvcTCBaseBitMap.properties
TOvcTCBaseBitMap properties

Access  	Margin

Adjust  	Name

Color  	Owner

ComponentCount 	References

ComponentIndex 	ShowHint

Components 	Table

ComponentState 	TableColor

DesignInfo 	TableFont

Font  	Tag

Hint


TOvcTCBaseEntryField
TOvcTCBaseEntryField class

See also: properties, methods, events, hierarchy

Class Overview

The TOvcTCBaseEntryField class is the ancestor to the cell components that are based on the Orpheus simple, picture, and numeric edit fields. It is an abstract ancestor class, so you should not instantiate any objects from it.

In common with the TOvcBaseEntryField, this class defines all the core common properties and methods used by the actual cell components. These components (the TOvcTCSimpleField, TOvcTCPictureField and TOvcTCNumericField) are simple descendants from this class and really only define different editing controls used for editing the data.

Most of the properties defined by this class are the same as the properties defined in the TOvcBaseEntryField class. Therefore they are not documented again here. These properties are not used by the cell components themselves, but they initialize the editing control when the user wants to edit a cell based on TOvcTCBaseEntryField.

The TOvcTCBaseEntryField class and descendants mark a departure from many of the other cell classes. Components derived from this class automatically create two instances of the underlying editing control when they are created. The first of these two controls is used exclusively for generating the string to be displayed in the cell and the second is the actual editing control (it is hidden until the user wants to edit a cell, when it is moved into place and shown). The other cell components discussed so far create their editing controls only when cell data needs to be edited.

There are many reasons for this departure. One reason is that having the two editing controls around means that the cell class is easier to write. It does not have to store the properties for the fields because the editing controls do that, making the storing and loading of the cell component from the DFM file easier. A second reason is that generating the string that the cell component displays is much easier if there is an Orpheus entry field control around to do the hard work. The downside to this design is that more system resources are used. Two windowed controls exist for the life of the cell, compared with one windowed control that is created on the fly when a cell needs to be edited.


TOvcTCBaseEntryField hierarchy


TOvcTCBaseEntryField.CanStopEditing
CanStopEditing method

function TOvcTCBaseEntryField.CanStopEditing(SaveValue : Boolean) : Boolean; override;

CanStopEditing determines whether the edited data is valid and editing can be stopped.

If SaveValue is True, CanStopEditing calls the ValidateSelf method of the editing control, returning the result of the call (if the data is valid CanStopEditing returns True, otherwise it returns False). If SaveValue is False, CanStopEditing calls the Restore method of the editing control to clear any pending validation and then returns True.

See also: StartEditing, StopEditing


TOvcTCBaseEntryField.Create
Create constructor

constructor TOvcTCBaseEntryField.Create(AOwner : TComponent); override;

Create an instance of a TOvcTCBaseEntryField object.

In addition to creating the instance of the cell, the Create constructor creates two instances of the editing control, one for generating the display strings, and one for editing the cell data. The controls are created by two separate calls to CreateEntryField.

See also: CreateEntryField


TOvcTCBaseEntryField.CreateEntryField
CreateEntryField abstract method

function TOvcTCBaseEntryField.CreateEntryField(AOwner : TComponent) : TOvcBaseEntryField; virtual; abstract;

CreateEntryField creates an editing control for the cell component.

Although the return value is declared as a TOvcBaseEntryField, CreateEntryField must create a descendant of it instead. This is because the descendant must follow the editing control guidelines (i.e., it must pass all WM_KEYDOWN messages on to the table). The descendants of TOvcTCBaseEntryField override this method to create an editing control. For example, the TOvcTCSimpleField component overrides CreateEntryField to create an object of type TOvcTCSimpleFieldEdit (a descendant of TOvcSimpleField, which is a descendant of TOvcBaseEntryField). The TOvcTCSimpleFieldEdit class has a method that calls its owning cell's FilterTableKey method for every WM_KEYDOWN message.

See also: Create


TOvcTCBaseEntryField.Paint
Paint method

procedure TOvcTCBaseEntryField.Paint(Canvas : TCanvas; RowNum : TRowNum; ColNum : TColNum; CellWidth, CellHeight : Integer; const CellAttr : TOvcCellAttributes; Data : Pointer); override;

Paint the string representation of the data in the cell.

Canvas is where the cell should be painted. RowNum and ColNum are the row and column numbers of the cell being painted. CellAttr is a fully resolved set of attributes for the current cell.

Data is a pointer to the data. Its type is defined by properties in the descendent cell class. For example, if the descendent class is a TOvcTCPictureField and the current object instance is declared with a DataType property of pftDate, then Data points to a variable of type TOvcDate.

The Paint method uses the precreated editing control that was created to help with display. It calls the control's SetValue method, passing the dereferenced Data pointer, then it calls the control's AsString method to get the displayable string, and finally it calls the inherited Paint method to actually display the string.

See also: Create, TOvcTCBaseString.Paint


TOvcTCBaseEntryField.StartEditing
StartEditing method

procedure TOvcTCBaseEntryField.StartEditing(RowNum : TRowNum; ColNum : TColNum; CellRect : TRect; const CellAttr : TOvcCellAttributes; Data : Pointer); override;

StartEditing sets up and shows the editing control for the cell.

RowNum and ColNum are the row and column numbers of the cell being edited. CellRect is the rectangle of the cell with respect to the displayed table. CellAttr is a fully resolved set of attributes for the cell.

For a description of the Data parameter, see the Paint method.

StartEditing sets the required properties of the edit control and then makes the editing control visible. The editing control's value is set by calling its SetValue method, passing the dereferenced Data pointer.

See also: CanStopEditing, Paint, StopEditing


TOvcTCBaseEntryField.StopEditing
StopEditing method

procedure TOvcTCBaseEntryField.StopEditing(SaveValue : Boolean; Data : Pointer); override;

StopEditing saves the edited data and hides the editing control.

If SaveValue is True, StopEditing gets the edited data by calling the GetValue method of the editing control and copying the result to the Data pointer. If SaveValue is False, the edited value is discarded.

The StopEditing method then hides the editing control.

See also: CanStopEditing, StartEditing


TOvcTCBaseEntryField.events
TOvcTCBaseEntryField events

OnClick 	OnExit

OnChange	OnKeyDown

OnDblClick 	OnKeyPress

OnDragDrop 	OnKeyUp

OnDragOver 	OnMouseDown

OnEndDrag 	OnMouseMove

OnEnter 	OnMouseUp


TOvcTCBaseEntryField.methods
TOvcTCBaseEntryField methods

Assign	HasParent

AssignTo 	IncRefs

CanStopEditing	InheritsFrom

ChangeName 	InitInstance

ClassInfo	InsertComponent

ClassName	InstanceSize

ClassParent	Loaded

ClassType	MethodAddress

Create	MethodName

CreateEntryField	NewInstance

DecRefs	Notification

DefaultHandler	Paint

Destroy	ReadState

DestroyComponents	RemoveComponent

Destroying	ResolveAttributes

Dispatch	SendKeyToTable

EditHandle	SetDesigning

EditHide	SetName

EditMove	StartEditing

FieldAddress	StopEditing

FilterTableKey	TableWantsTab

FindComponent	ValidateRename

Free	WriteComponents

FreeInstance	WriteState


TOvcTCBaseEntryField.properties
TOvcTCBaseEntryField properties

Access  	InsertPushes

Adjust  	Margin

AutoAdvanceChar	MaxLength

AutoAdvanceLeftRight	Name

AutoSelect	Owner

BeepOnError  	PadChar

CaretIns  	PasswordChar

CaretOvr  	PasswordMode

Color  	RangeHi

ComponentCount 	RangeLo

ComponentIndex 	References

Components 	RightJustify

ComponentState 	ShowHint

ControlCharColor  	StripLiterals

DecimalPlaces  	Table

DesignInfo 	TableColor

Font  	TableFont

ForceInsert  	Tag

ForceOvertype  	TrimBlanks

HighlightColors  	UseASCIIZStrings

Hint  	UseWordWrap

InputRequired


TOvcTCBaseString
TOvcTCBaseString class

See also: properties, methods, events, hierarchy

Class Overview

The TOvcTCBaseString class is an abstract class that defines the main functions of a cell component that displays strings. It supports both length-byte strings and null-terminated strings.

TOvcTCBaseString essentially consists of a Paint method for painting strings in a cell. The painting algorithm can paint the strings either word wrapped or not, and in all the nine possible adjustment positions. It is assumed that all string-type cell components will descend from this class and call its Paint method to do the actual painting.

This class is designed as an abstract class, so you should not create any instances of it.


TOvcTCBaseString hierarchy


TOvcTCBaseString.OnChange
OnChange event

property TOvcTCBaseString.OnChange : TNotifyEvent

OnChange is triggered when the data in the string editing control changes.

The OnChange event applies to the editing control when it is created, not to the string cell component itself (the cell component has no

visual representation at run-time). This event has the same meaning as that for Delphi's TEdit component. The StartEditing method will set the newly created editing control's OnChange event handler equal to this one.


TOvcTCBaseString.Paint
Paint method

procedure TOvcTCBaseString.Paint(Canvas : TCanvas; RowNum : TRowNum; ColNum : TColNum; CellWidth, CellHeight : Integer; const CellAttr : TOvcCellAttributes; Data : Pointer); override;

Paint the string in the cell.

Canvas is where the cell should be painted. RowNum and ColNum are the row and column numbers of the cell being painted. CellAttr is a fully resolved set of attributes for the current cell.

Data is a pointer to a string. If the UseASCIIZStrings property is True, Paint assumes that the string is null terminated. If UseASCIIZStrings is False, Paint assumes a length-byte string. The string is drawn on the canvas in the position dictated by CellAttr.Adjust and by the cell object's Margin property. For example, if CellAttr.Adjust is otaCenterLeft, the string is drawn on the left side of the cell, halfway between the top and the bottom of the cell with Margin pixels between it and the side of the cell.

If the UseWordWrap property is True, the text of the string is word-wrapped inside the cell.

See also: UseASCIIZStrings, UseWordWrap


TOvcTCBaseString.UseASCIIZStrings
UseASCIIZStrings property

property TOvcTCBaseString.UseASCIIZStrings : Boolean

Default: False

UseASCIIZStrings determines whether the cell uses null-terminated or length-byte strings.

If UseASCIIZStrings is True, the Paint, StartEditing, and StopEditing methods all expect their Data parameter to point to a null-terminated string. If it is False, they expect a length-byte string.

See also: UseWordWrap


TOvcTCBaseString.UseWordWrap
UseWordWrap property

property TOvcTCBaseString.UseWordWrap : Boolean

Default: False

UseWordWrap determines whether text wraps within the cell.

If UseWordWrap is True, the Paint method will use word wrap for the string passed to it. The Paint method uses a call to the Windows API DrawText routine, which left adjusts, right adjusts, or center adjusts the text. If the Adjust property is otaTopLeft, otaCenterLeft, or otaBottomLeft, the left adjustment method is used. If it is otaTopCenter, otaCenter, or otaBottomCenter, the center adjustment method is used. If it is otaTopRight, otaCenterRight, or otaBottomRight, the right adjustment method is used.

See also: UseASCIIZStrings


TOvcTCBaseString.events
TOvcTCBaseString events

OnClick 	OnExit

OnChange	OnKeyDown

OnDblClick 	OnKeyPress

OnDragDrop 	OnKeyUp

OnDragOver 	OnMouseDown

OnEndDrag 	OnMouseMove

OnEnter 	OnMouseUp


TOvcTCBaseString.methods
TOvcTCBaseString methods

Assign	HasParent

AssignTo 	IncRefs

CanStopEditing	InheritsFrom

ChangeName 	InitInstance

ClassInfo	InsertComponent

ClassName	InstanceSize

ClassParent	Loaded

ClassType	MethodAddress

Create	MethodName

DecRefs	NewInstance

DefaultHandler	Notification

DefineProperties 	Paint

Destroy	ReadState

DestroyComponents	RemoveComponent

Destroying	ResolveAttributes

Dispatch	SendKeyToTable

EditHandle	SetDesigning

EditHide	SetName

EditMove	StartEditing

FieldAddress	StopEditing

FilterTableKey	TableWantsTab

FindComponent	ValidateRename

Free	WriteComponents

FreeInstance	WriteState


TOvcTCBaseString.properties
TOvcTCBaseString properties

Access  	Name

Adjust  	Owner

Color  	References

ComponentCount 	ShowHint

ComponentIndex 	Table

Components 	TableColor

ComponentState 	TableFont

DesignInfo 	Tag

Font  	UseASCIIZStrings

Hint  	UseWordWrap

Margin


TOvcTCCheckBox
 TOvcTCCheckBox component

See also: properties, methods, events, hierarchy

Component Overview

The TOvcTCCheckBox component defines a cell type for checkboxes. Like a normal checkbox, you can define whether the checkbox accepts the grayed state or not. Otherwise, the states for the cell are limited to unchecked or checked.

The data passed to the painting and editing methods is a variable of type TCheckBoxState.


TOvcTCCheckBox hierarchy


TOvcTCCheckBox.AllowGrayed
AllowGrayed property

property TOvcTCCheckBox.AllowGrayed : Boolean

Default: False

AllowGrayed indicates whether the grayed checkbox state can be used.

If you set AllowGrayed to True, CellGlyphs.ActiveCount is forced to 3. If you set AllowGrayed to False, CellGlyphs.ActiveCount is forced to 2.

Since AllowGrayed drives the value of CellGlyphs.ActiveCount, the class' methods do not allow you to alter the value of CellGlyphs.ActiveCount.


TOvcTCCheckBox.CanAssignGlyphs
CanAssignGlyphs method

function TOvcTCCheckBox.CanAssignGlyphs(CBG : TOvcCellGlyphs) : Boolean; override;

CanAssignGlyphs determines whether the instance can accept a glyph resource.

Since a checkbox has one of three states, this routine returns True only if the number of glyphs in the glyph resource (CBG.Count) is 3. For any other value of CBG.Count, CanAssignGlyphs returns False.

Therefore, if you want to use a different set of glyphs for a checkbox cell you will have to create a bitmap with exactly three glyphs. The first glyph must be for the unchecked state, the second for the checked state, and the third for the grayed state.


TOvcTCCheckBox.Paint
Paint method

procedure TOvcTCCheckBox.Paint(Canvas : TCanvas; RowNum : TRowNum; ColNum : TColNum; CellWidth, CellHeight : Integer; const CellAttr : TOvcCellAttributes; Data : Pointer); override;

Paint the required checkbox glyph in the cell.

Canvas is where the cell should be painted. RowNum and ColNum are the row and column numbers of the cell being painted. CellAttr is a fully resolved set of attributes for the current cell.

Data is a pointer to a variable of type TCheckBoxState. The value of the variable is the state of the checkbox. The Paint method converts the checkbox state to a (zero-based) index in a local variable. cbUnchecked is converted to 0, cbChecked is converted to 1, and cbGrayed is converted to 2. The method then calls the inherited Paint method with a pointer to this local variable as the Data parameter.


TOvcTCCheckBox.StartEditing
StartEditing method

procedure TOvcTCCheckBox.StartEditing(RowNum : TRowNum; ColNum : TColNum; CellRect : TRect; const CellAttr : TOvcCellAttributes; Data : Pointer); override;

StartEditing creates an editor for the checkbox cell.

The method lets the ancestor's StartEditing method do most of the work. Before calling the inherited method, StartEditing must first convert Data.

For a description of the Data parameter, see the Paint method.

See also: Paint, StopEditing


TOvcTCCheckBox.StopEditing
StopEditing method

procedure TOvcTCCheckBox.StopEditing(SaveValue : Boolean; Data : Pointer); override;

StopEditing saves the checkbox data and destroys the editing control.

If SaveValue is True, this method saves the checkbox data. The ancestor (which has been in control of the editing session) uses an integer value as its index, so the StopEditing method must convert this integral value back into a TCheckBoxState value and save it in the original Data pointer. The value 0 is converted to cbUnChecked, 1 to cbChecked, and 2 to cbGrayed.

See also: StartEditing


TOvcTCCheckBox.events
TOvcTCCheckBox events

OnClick 	OnKeyDown

OnDblClick 	OnKeyPress

OnDragDrop 	OnKeyUp

OnDragOver 	OnMouseDown

OnEndDrag 	OnMouseMove

OnEnter 	OnMouseUp

OnExit


TOvcTCCheckBox.methods
TOvcTCCheckBox methods

Assign	HasParent

AssignTo 	IncRefs

CanAssignGlyphs	InheritsFrom

CanStopEditing	InitInstance

ChangeName 	InsertComponent

ClassInfo	InstanceSize

ClassName	Loaded

ClassParent	MethodAddress

ClassType	MethodName

Create	NewInstance

DecRefs	Notification

DefaultHandler	Paint

DefineProperties 	ReadState

Destroy	RemoveComponent

DestroyComponents	ResolveAttributes

Destroying	SendKeyToTable

Dispatch	SetDesigning

EditHandle	SetName

EditHide	StartEditing

EditMove	StopEditing

FieldAddress	TableWantsTab

FilterTableKey	ValidateRename

FindComponent	WriteComponents

Free	WriteState

FreeInstance


TOvcTCCheckBox.properties
TOvcTCCheckBox properties

Access	Hint

Adjust	Margin

AllowGrayed	Name

CellGlyphs	Owner

Color	References

ComponentCount 	ShowHint

ComponentIndex 	Table

Components 	TableColor

ComponentState 	TableFont

DesignInfo 	Tag

Font


TOvcTCColHead
 TOvcTCColHead component

See also: properties, methods, events, hierarchy

Component Overview

The TOvcTCColHead component is a simple descendant of the TOvcTCString class, expressly designed for column headings. The component ignores all data passed to it and instead displays spreadsheet-like letters for the cell.

The first column after the locked columns has the heading 'A', the next is 'B', and so on until 'Z'. Then the sequence starts with 'AA' and continues until 'AZ', followed by 'BA' on to 'BZ', and so on.

The LockedRowsCell property of the TOvcTable component can be set to a component of this type, causing the columns in the table to be easily identified.


TOvcTCColHead hierarchy


TOvcTCColHead.Create
Create constructor

constructor TOvcTCColHead.Create(AOwner : TComponent);

Create makes an instance of a column heading cell component.

This constructor forces the Access property to otxReadOnly, UseASCIIZStrings to False, and UseWordWrap to False.


TOvcTCColHead.Headings
Headings property

property TOvcTCColHead.Headings : TStringList

 Headings is a list of column heading strings.

If the ShowLetters property is false and the Data pointer passed to the Paint method is nil, the cell component will use the relevant string in this string list for display purposes. The first string in

the list (element 0) will be used for column 0, element 1 for column 1 and so forth.

This property enables you to display column headings at design time. Use the string list editor to enter a set of strings, one line for each column, and set the ShowLetters property off.

See Also: ShowLetters


TOvcTCColHead.Paint
Paint method

procedure TOvcTCColHead.Paint(Canvas : TCanvas; RowNum : TRowNum; ColNum : TColNum; CellWidth, CellHeight : Integer;

 const CellAttr : TOvcCellAttributes; Data : Pointer); override;

Paint the column letters in the cell.

If the ShowLetters property is False the Paint method looks at the Data pointer. If this is non-nil, the Paint method calls its inherited

ancestral method passing on the Data pointer. If the Data pointer is nil, it will get the string to display from the Headings string list

using the passed ColNum value as index. If there is a string at this index in the Headings list the inherited Paint method is called with

its address; otherwise the inherited method is called with the address of an empty string instead.

If ShowLetters is True, the Data pointer is ignored entirely, and instead a spreadsheet-like string is generated to define the column

number and the address of this is passed onto the inherited Paint method.


TOvcTCColHead.ShowActiveCol
ShowActiveCol property

property TOvcTCColHead.ShowActiveCol : Boolean

ShowActiveCol indicates whether an arrow should be displayed for the active column.

If ShowActiveCol is True, a down arrow is displayed for the active column. If it is False, the column number is displayed for the active column.


TOvcTCColHead.ShowLetters
ShowLetters property

property ShowLetters : boolean

Default: True

ShowLetters determines whether spreadsheet style letters are displayed.

If ShowLetters is True the Paint method will display spreadsheet style letters for the columns (i.e. 'A' will be displayed for the firstunlocked column, the next will be 'B' and so on). If ShowLetters is

False the Paint method will display a string, either from the Headings string list property or the passed Data pointer.


TOvcTCColHead.events
TOvcTCColHead events

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp


TOvcTCColHead.methods
TOvcTCColHead methods

Assign	HasParent

AssignTo 	IncRefs

CanStopEditing	InheritsFrom

ChangeName 	InitInstance

ClassInfo	InsertComponent

ClassName	InstanceSize

ClassParent	Loaded

ClassType	MethodAddress

Create	MethodName

DecRefs	NewInstance

DefaultHandler	Notification

DefineProperties 	Paint

Destroy	ReadState

DestroyComponents	RemoveComponent

Destroying	ResolveAttributes

Dispatch	SendKeyToTable

EditHandle	SetDesigning

EditHide	SetName

EditMove	StartEditing

FieldAddress	StopEditing

FilterTableKey	TableWantsTab

FindComponent	ValidateRename

Free	WriteComponents

FreeInstance	WriteState


TOvcTCColHead.properties
TOvcTCColHead properties

Access  	Name

Adjust	Owner

Color	References

ComponentCount 	ShowActiveCol

ComponentIndex 	ShowHint

Components 	ShowLetters

ComponentState 	Table

DesignInfo 	TableColor

Font	TableFont

Headings	Tag

Hint  	UseASCIIZStrings

Margin	UseWordWrap


TOvcTCComboBox
 TOvcTCComboBox component

See also: properties, methods, events, hierarchy

Component Overview

The TOvcTCComboBox component encapsulates a combo box inside a cell. The three styles of combo box that are catered for are the drop down, drop down list and simple styles.

The data that is passed to the combo box cell in the Paint, StartEditing and StopEditing methods depends on the style of the combo box. For a drop down list combo box, the data simply consists of an integer: the index into an internal string list. The string list is set up beforehand (for example in the form designer) or can be initialized on the fly at run-time. The combo box cell will display the string at the given index in the string list.

For the other two types of combo box (drop down and simple), there is an edit field associated with the control: the user can either select an entry in the list or enter a new string in the edit field. The data that is passed to the cell takes account of this: it is a record whose first field is an integer and the second a string.

An inactive combo box cell just displays the string. A combo box cell that is active will show a representation of the button on the righthand side of the cell and the string is displayed on the left. Like the check box cell, this button is 'inert', you have to either press <F2> or double-click on the cell to start the editing mode.

The standard Windows combo box (from which the editing control for the combo box cell is descended) has a fixed vertical size that is proportional to the font being used. It is impossible to change the height of a combo box control, in this case to resize it to fit inside a cell boundary, and so the TOvcTCComboBox does not attempt to. It resizes the width of the combo box to fit the cell, but vertically it just places the control at the top of the cell. If the row height is too small to accommodate the combo box, the TOvcTCComboBox component will force the row height to be the same as the combo box height.


TOvcTCComboBox hierarchy


TOvcTCComboBox.AutoAdvanceChar
AutoAdvanceChar  property

property TOvcTCComboBox.AutoAdvanceChar : boolean

Default: False

AutoAdvanceChar determines what happens if the caret is at the end of the combo box's edit control and you enter another character.

If AutoAdvanceChar is True the combo box's edit control sends (via SendKeyToTable) a WM_KEYDOWN message to the table containing the VK_RIGHT virtual keystroke. The effect of this will be for the table to stop editing the current cell and move the active cell right one column.

If AutoAdvanceChar is False, the caret remains where it is.

See also: AutoAdvanceLeftRight


TOvcTCComboBox.AutoAdvanceLeftRight
AutoAdvanceLeftRight property

property TOvcTCComboBox.AutoAdvanceLeftRight : boolean

Default: False

AutoAdvanceLeftRight determines what happens if the caret is at the end of the combo box's edit control and you enter a caret movement command.

If the combo box style is cbDropDownList, then if AutoAdvanceLeftRight is True pressing <Left> or <Right> will cause the table to move the active cell left or right. If it is False, pressing <Left> and <Right> will select the previous or next string in the string list.

If the combo box style is not cbDropDownList, there are two cases to consider when AutoAdvanceLeftRight is true. First is when the caret is at the beginning of the field and the user presses the left arrow key. In this case the combo box's edit control sends (via SendKeyToTable) a WM_KEYDOWN message to the table containing the VK_LEFT virtual keystroke. The effect of this will be for the table to stop editing the current cell and move the active cell left one column.

Second is when the caret is at the end of the field and the user presses the right arrow key. A similar action occurs with the effect

that the table stops editing the current cell and moves the active  cell right one column.

If AutoAdvanceLeftRight is False in either of these two situations, the caret remains where it is.

See also: AutoAdvanceChar


TOvcTCComboBox.DropDownCount
DropDownCount property

property TOvcTCComboBox.DropDownCount : integer

Default: 8

DropDownCount is the number of items visible in the drop down list.

This is the same property as the TComboBox component's DropDownCount property in Delphi.


TOvcTCComboBox.Items
Items property

property TOvcTCComboBox.Items : TStrings

Items is the list of pre-set strings for the combo box

This is the same property as the TComboBox component's Items property in Delphi.


TOvcTCComboBox.MaxLength
MaxLength property

property TOvcTCComboBox.MaxLength : word

Default: 0

=> MaxLength is the maximum length of the string that can be edited by the cell

This is the same property as the TComboBox component's MaxLength property in Delphi.

Note that the strings in the Items property can be longer than this (only the index is returned if one of these is selected), but any string that is entered in the edit control of the combo box is forced to be less than or equal to this length.


TOvcTCComboBox.OnChange
OnChange event

property TOvcTCComboBox.OnChange : TNotifyEvent

OnChange is triggered when the data in the combo box cell changes.

The OnChange event applies to the editing control when it is created, not to the combo box cell component itself (the cell component has no visual representation at run-time). This event has the same meaning as that for Delphi's TComboBox component. The StartEditing method will set the newly created editing control's OnChange event handler equal to this one.

The event has the same meaning as for the normal Delphi components. For futher information, see the OnChange event in the Delphi help.


TOvcTCComboBox.OnDrawItem
OnDrawItem event

property TOvcTCComboBox.OnDrawItem : TDrawItemEvent

OnDrawItem defines an event handler that is called when an item in the combo box list requires drawing.

The OnDrawItem event applies to the editing control when it is created, not to the combo box cell component itself (the cell component has no visual representation at run-time). This event has the same meaning as that for Delphi's TComboBox component. The StartEditing method will set the newly created editing control's OnDrawItem event handler equal to this one.

The event has the same meaning as for the normal Delphi components. For futher information, see the OnDrawItem event in the Delphi help.


TOvcTCComboBox.OnDropDown
OnDropDown event

property TOvcTCComboBox.OnDropDown : TNotifyEvent

OnDropDown is triggered when the data in the combo box cell changes.

The OnDropDown event applies to the editing control when it is created, not to the combo box cell component itself (the cell component has no visual representation at run-time). This event has the same meaning as that for Delphi's TComboBox component. The StartEditing method will set the newly created editing control's OnDropDown event handler equal to this one.

The event has the same meaning as for the normal Delphi components. For futher information, see the OnDropDown event in the Delphi help.


TOvcTCComboBox.OnMeasureItem
OnMeasureItem event

property TOvcTCComboBox.OnMeasureItem : TMeasureItemEvent

OnMeasureItem defines an event handler that is called when an item in the combo box list requires measuring.

The OnMeasureItem event applies to the editing control when it is created, not to the combo box cell component itself (the cell component has no visual representation at run-time). This event has the same meaning as that for Delphi's TComboBox component. The StartEditing method will set the newly created editing control's OnMeasureItem event handler equal to this one.

The event has the same meaning as for the normal Delphi components. For futher information, see the OnMeasureItem event in the Delphi help.


TOvcTCComboBox.Paint
Paint method

procedure TOvcTCComboBox.Paint(Canvas : TCanvas; RowNum : TRowNum; ColNum : TColNum; CellWidth, CellHeight : integer; const CellAttr : TOvcCellAttributes; Data : pointer); override;

Paint paints a representation of a combo box in a cell

Canvas is where the cell should be painted. RowNum and ColNum are the row and column numbers of the cell being painted. CellAttr is a fully resolved set of attributes for the current cell.

Data is a pointer to the data. If the combo box cell has a Style value of cbDropDownList then the data is an integer. The value of this

integer variable is an index value, and is either in the range 0 to Items.Count-1 or is -1; the latter value meaning that no item has been selected. Note that the default action of the combo box control is to assume that -1 is the same as 0.

If however the combo box has a Style value that is not cbDropDownList, the data is a record with two fields:

PCellComboBoxInfo = ^TCellComboBoxInfo;

TCellComboBoxInfo = record

  Index : integer;          {index into Items list, or -1}

  St    : string;           {text if Index is -1}

end;

The first field is an integer as before, and the second field is a string. The integer field is an index with the same values previously mentioned, the string is a special value of the combo box that's not found in the list. Note that only the first MaxLength characters in the string are used.

The Paint method determines the string to display as follows. If the index value (which is always present) is in the range 0 to Items.Count-1, the Paint method extracts the string at the given index from the Items property and uses that. If the index value is -1, there is a choice. If the combo box has the drop down list style, the Paint method uses an empty string. If the combo box is not of this style the Paint method uses the string field of the passed record.

Having obtained the string to display the Paint method then determines whether the cell address refers to the active cell in the table. If not, the inherited Paint method is called to display the string. If it is, the Paint method draws a combo box button on the right hand side of the cell and then calls the inherited Paint method to display the string. In the latter case the cell rectangle passed to the ancestor is reduced in size by the width of the combo box button.

See also: TOvcTCBaseString.Paint


TOvcTCComboBox.StartEditing
StartEditing method

procedure TOvcTCComboBox.StartEditing (RowNum : TRowNum; ColNum : TColNum; CellRect : TRect; const CellAttr : TOvcCellAttributes; Data : pointer); override;

StartEditing sets up and shows the combo box editing control for the cell

RowNum and ColNum are the row and column numbers of the cell being edited. CellRect is the rectangle of the cell with respect to the

table. CellAttr is a fully resolved set of attributes for the current cell.

For a description of the Data parameter, see the Paint method.

The cell component creates a combo box control to do the editing and places it over the cell rectangle, adjusting the width if necessary.

The combo box control is placed flush against the top of the cell and if the height of the cell is insufficient to hold the combo box, the

row height for the table is increased.

For a drop down list style combo box, only the passed index is used to set the value of the editing control's ItemIndex property. For other styles, if the index is in range for the Items property then it is used to set ItemIndex; if it is not the passed string is used to

initialize the combo box control's Text property.

See also: Paint, StopEditing


TOvcTCComboBox.StopEditing
StopEditing method

procedure TOvcTCComboBox.StopEditing(SaveValue : boolean; Data : pointer); override;

StopEditing saves the edited data and frees the editing control

If SaveValue is True, the data in the combo box control is saved to the Data pointer. If SaveValue is False, the data is discarded. For a

description of the Data parameter, see the Paint method.

For a drop down list style combo box, the index of the selected item (the TComboBox's ItemIndex property) is saved.

For other styles, the index of the selected item is saved in the first field of the Data record. If the value of the ItemIndex property is -1

the Text property of the combo box is saved in the second field. If the value is not -1, the string at ItemIndex in the Items string list

is saved in this second field (for convenience purposes). Either way only a maximum of MaxLength characters are transferred.


TOvcTCComboBox.Style
Style property

property TOvcTCComboBox.Style : TComboBoxStyle

Default: csDropDown

Style indicates the type of combo box

The TOvcTCComboBox component only supports three styles: drop down, drop down list and simple.


TOvcTCComboBox.events
TOvcTCComboBox events

OnClick 	OnExit

OnChange	OnKeyDown

OnDblClick 	OnKeyPress

OnDragDrop 	OnKeyUp

OnDragOver 	OnMeasureItem

OnDrawItem	OnMouseDown

OnDropDown	OnMouseMove

OnEndDrag 	OnMouseUp

OnEnter


TOvcTCComboBox.methods
TOvcTCComboBox methods

Assign	HasParent

AssignTo 	IncRefs

CanStopEditing	InheritsFrom

ChangeName 	InitInstance

ClassInfo	InsertComponent

ClassName	InstanceSize

ClassParent	Loaded

ClassType	MethodAddress

Create	MethodName

DecRefs	NewInstance

DefaultHandler	Notification

DefineProperties 	Paint

Destroy	ReadState

DestroyComponents	RemoveComponent

Destroying	ResolveAttributes

Dispatch	SendKeyToTable

EditHandle	SetDesigning

EditHide	SetName

EditMove	StartEditing

FieldAddress	StopEditing

FilterTableKey	TableWantsTab

FindComponent	ValidateRename

Free	WriteComponents

FreeInstance	WriteState


TOvcTCComboBox.properties
TOvcTCComboBox properties

Access  	Margin

Adjust  	MaxLength

AutoAdvanceChar	Name

AutoAdvanceLeftRight	Owner

Color  	References

ComponentCount 	ShowHint

ComponentIndex 	Sorted

Components 	Style

ComponentState 	Table

DesignInfo 	TableColor

DropDownCount	TableFont

Font  	Tag

Hint  	UseASCIIZStrings

Items	UseWordWrap


TOvcTCGlyph
 TOvcTCGlyph component

See also: properties, methods, events, hierarchy

Component Overview

The TOvcTCGlyph component defines a cell type that displays one of a set of glyphs in a bitmap and, in edit mode, cycles through those glyphs. Glyphs are equal-sized subdivisions of a bitmap.

The component is designed to be more general than the checkbox cell component. The checkbox is a more restricted component in that it has three states and 2 or 3 of them can be cycled through in edit mode. TOvcTCGlyph, on the other hand, can display any number of glyphs and cycle through all of them in edit mode using the spacebar.

The glyphs that are used by the component are stored in a TOvcCellGlyphs class.

The data transferred to the painting and editing methods is an integer. Its value is the zero-based index into the set of glyphs in the bitmap.


TOvcTCGlyph hierarchy


TOvcTCGlyph.CanAssignGlyphs
CanAssignGlyphs virtual method

function TOvcTCGlyph.CanAssignGlyphs(CBG : TOvcCellGlyphs) : Boolean; virtual;

CanAssignGlyphs determines whether the instance can accept a glyph resource.

This method is defined for the checkbox cell component (TOvcTCCheckBox, a descendant of this class), which can accept a bitmap only if it has three glyphs. By default the return value from CanAssignGlyphs is True.

The CellGlyphs property write routine calls this method before assigning the glyph resource. If CanAssignGlyphs returns False, the resource is not assigned to the instance.

See also: CellGlyphs


TOvcTCGlyph.CellGlyphs
CellGlyphs property

property TOvcTCGlyph.CellGlyphs : TOvcCellGlyphs

Default: the checkbox glyph resource

CellGlyphs is the glyph resource for the cell.

This property defines the glyphs for the instance. It is of type TOvcCellGlyphs. The resource defines the bitmap, the number of glyphs in the bitmap, and the number of active glyphs in the bitmap; all of which are required for painting the cell.

When assigning to the property, the write routine calls the CanAssignGlyphs method to determine whether the glyph resource can be accepted. If CanAssignGlyphs returns False, the assignment does not take place.

See also: CanAssignGlyphs


TOvcTCGlyph.Paint
Paint method

procedure TOvcTCGlyph.Paint(Canvas : TCanvas; RowNum : TRowNum; ColNum : TColNum; CellWidth, CellHeight : Integer; const CellAttr : TOvcCellAttributes; Data : Pointer); override;

Paint the required glyph in the cell.

Canvas is where the cell should be painted. RowNum and ColNum are the row and column numbers of the cell being painted. CellAttr is a fully resolved set of attributes for the current cell.

Data is a pointer to an integer. The value of the integer is the (zero-based) index of the glyph to be displayed. The Paint method ensures that this index is between 0 and CellGlyphs.ActiveCount-1. If it is not, the index is forced to 0.

The method creates an internal TCellBitMapInfo record with the following values: the Index field from the above calculation, and the other fields from the relevant fields of the glyph resource. The Paint method then calls the inherited Paint method, passing the TCellBitMapInfo record, to do the actual painting of the glyph.


TOvcTCGlyph.StartEditing
StartEditing method

procedure TOvcTCGlyph.StartEditing(RowNum : TRowNum; ColNum : TColNum; CellRect : TRect; const CellAttr : TOvcCellAttributes; Data : Pointer); override;

StartEditing creates an editor for the glyph cell.

The editor that is created lets the user cycle through the active glyphs in the resource using the left mouse button or the spacebar. <Backspace> can be used to cycle through the glyphs in reverse order.

RowNum is the row number for the cell and ColNum is its column number. CellRect is the rectangle of the cell with respect to the table. CellAttr is a fully resolved set of attributes for the current cell.

For a description of the Data parameter, see the Paint method.

See also: Paint


TOvcTCGlyph.StopEditing
StopEditing method

procedure TOvcTCGlyph.StopEditing(SaveValue : Boolean; Data : Pointer); override;

StopEditing saves the glyph index and destroys the editing control.

If SaveValue is True, StopEditing saves the index of the edited glyph back to the Data pointer.

For a description of the Data parameter, see the Paint method.

See also: StartEditing


TOvcTCGlyph.events
TOvcTCGlyph events

OnClick 	OnKeyDown

OnDblClick 	OnKeyPress

OnDragDrop 	OnKeyUp

OnDragOver 	OnMouseDown

OnEndDrag 	OnMouseMove

OnEnter 	OnMouseUp

OnExit


TOvcTCGlyph.methods
TOvcTCGlyph methods

Assign	HasParent

AssignTo 	IncRefs

CanAssignGlyphs	InheritsFrom

CanStopEditing	InitInstance

ChangeName 	InsertComponent

ClassInfo	InstanceSize

ClassName	Loaded

ClassParent	MethodAddress

ClassType	MethodName

Create	NewInstance

DecRefs	Notification

DefaultHandler	Paint

DefineProperties 	ReadState

Destroy	RemoveComponent

DestroyComponents	ResolveAttributes

Destroying	SendKeyToTable

Dispatch	SetDesigning

EditHandle	SetName

EditHide	StartEditing

EditMove	StopEditing

FieldAddress	TableWantsTab

FilterTableKey	ValidateRename

FindComponent	WriteComponents

Free	WriteState

FreeInstance


TOvcTCGlyph.properties
TOvcTCGlyph properties

Access	Hint

Adjust	Margin

CellGlyphs	Name

Color	Owner

ComponentCount 	References

ComponentIndex 	ShowHint

Components 	Table

ComponentState 	TableColor

DesignInfo 	TableFont

Font  	Tag


TOvcTCMemo
 TOvcTCMemo component

See also: properties, methods, events, hierarchy

Component Overview

The TOvcTCMemo component is a cell component that enables the user to edit a memo in a cell.

Although descended from a TOvcTCBaseString class, this class makes two very important restrictions: the UseWordWrap property must be set to True and the UseASCIIZStrings property must be set to True. The Create constructor ensures that these two properties are set True. The memo cell component must display its data (a null-terminated string) in a word wrapped format.

The data that is passed to the Paint and StartEditing methods is a pointer to a null-terminated string. The class has no support for the alternative TMemo data representations (the length byte string and the TStringList).

The memo editor that is created fits exactly into the cell boundaries. This means that the space is extremely cramped and the text in the memo control must be scrolled to see it all. However, since space is at a premium, the memo editor is created without scrollbars, so you can only scroll the text by use of the keyboard.


TOvcTCMemo hierarchy


TOvcTCMemo.Create
Create constructor

constructor TOvcTCMemo.Create(AOwner : TComponent); override;

Create an instance of memo cell component.

This constructor creates the instance of the cell component and forces the UseASCIIZStrings and UseWordWrap properties to True.


TOvcTCMemo.CreateEditControl
CreateEditControl virtual method

function TOvcTCMemo.CreateEditControl(AOwner : TComponent) : TOvcTCMemoEdit; virtual;

CreateEditControl creates an editing control based on TMemo.

This method is virtual so that you can override the creation of the memo editing control, usually so that you can replace the default control with a control instantiated from a descendent type. CreateEditControl creates an editing control based on TMemo and returns it as the function result. It is called from the StartEditing method.

For more information on the TOvcTCMemoEdit type, see the source code.

See also: StartEditing


TOvcTCMemo.MaxLength
MaxLength property

property TOvcTCMemo.MaxLength : Word

Default: 0

MaxLength is the maximum number of characters that can be edited in the cell.

The value of MaxLength is used to set the MaxLength property of the memo editing control when it is created in the StartEditing method. It does not, however, limit the number of characters that can be displayed in the cell.

Unlike the TMemo MaxLength property, the value 0 is not allowed and you must specify a positive value. For a TMemo control, a MaxLength value of 0 implies no limit to the number of characters that can be edited. The TOvcTCMemo component requires you to explicitly state the number of characters. For this reason, the default value is not acceptable and you must change it.

The Data pointer that is passed to the StopEditing method must point to a variable that is at least MaxLength+1 bytes in size, or a memory overwrite will occur.

See also: StartEditing


TOvcTCMemo.StartEditing
StartEditing method

procedure TOvcTCMemo.StartEditing(RowNum : TRowNum; ColNum : TColNum; CellRect : TRect; const CellAttr : TOvcCellAttributes; Data : Pointer); override;

StartEditing creates the memo editing control for the cell.

StartEditing calls CreateEditControl to create the memo editing control and sets the properties so that the control can be displayed in the table at the correct position.

RowNum is the row number of the cell being edited and ColNum is its column number. CellRect is the rectangle of the cell with respect to the displayed table. CellAttr is a fully resolved set of attributes for the cell.

Data is a pointer to a null terminated string.

See also: MaxLength, StopEditing, TOvcBaseTableCell.StartEditing


TOvcTCMemo.StopEditing
StopEditing method

procedure TOvcTCMemo.StopEditing(SaveValue : Boolean; Data : Pointer); override;

StopEditing saves the memo and destroys the editing control.

If SaveValue is True, StopEditing saves the edited memo string back to the Data pointer.

StopEditing writes up to MaxLength+1 bytes to the Data pointer and you must ensure that the memory block is large enough. The string memory block being pointed to must be at least MaxLength+1 bytes long (the string itself will have a length of MaxLength characters or less); if the memory block is any less, the StopEditing method will cause a memory overwrite.

See also: StartEditing, TOvcBaseTableCell.StopEditing


TOvcTCMemo.WantReturns
WantReturns property

property TOvcTCMemo.WantReturns : Boolean

Default: False

WantReturns determines whether carriage returns are inserted in the memo text when <Enter> is pressed.

This property is used to set up the memo editing control after StartEditing creates it. If WantReturns is True and <Enter> is pressed, a carriage return is inserted in the memo text. If WantReturns is False and <Enter> is pressed, the default button for the form is selected. A carriage return can still be inserted into the text by pressing <CtrlEnter>. This property corresponds to the TMemo WantReturns property.

See also: WantTabs


TOvcTCMemo.WantTabs
WantTabs property

property TOvcTCMemo.WantTabs : Boolean

Default: False

WantTabs determines whether tab characters are inserted in the memo text.

This property is used to set up the memo editing control after StartEditing creates it. If WantTabs is True and <Tab> is pressed, a tab character is inserted in the memo text. If WantTabs is False and <Tab> is pressed, the focus is advanced to the next selectable control on the form. This property corresponds to the TMemo WantTabs property.

See also: WantReturns


TOvcTCMemo.events
TOvcTCMemo events

OnClick 	OnExit

OnChange	OnKeyDown

OnDblClick 	OnKeyPress

OnDragDrop 	OnKeyUp

OnDragOver 	OnMouseDown

OnEndDrag 	OnMouseMove

OnEnter 	OnMouseUp


TOvcTCMemo.methods
TOvcTCMemo methods

Assign	HasParent

AssignTo 	IncRefs

CanStopEditing	InheritsFrom

ChangeName 	InitInstance

ClassInfo	InsertComponent

ClassName	InstanceSize

ClassParent	Loaded

ClassType	MethodAddress

Create	MethodName

CreateEditControl	NewInstance

DecRefs	Notification

DefaultHandler	Paint

DefineProperties 	ReadState

Destroy	RemoveComponent

DestroyComponents	ResolveAttributes

Destroying	SendKeyToTable

Dispatch	SetDesigning

EditHandle	SetName

EditHide	StartEditing

EditMove	StopEditing

FieldAddress	TableWantsTab

FilterTableKey	ValidateRename

FindComponent	WriteComponents

Free	WriteState

FreeInstance


TOvcTCMemo.properties
TOvcTCMemo properties

Access	Name

Adjust	Owner

Color	References

ComponentCount 	ShowHint

ComponentIndex 	Table

Components 	TableColor

ComponentState 	TableFont

DesignInfo 	Tag

Font	UseASCIIZStrings

Hint	UseWordWrap

Margin	WantReturns

MaxLength	WantTabs


TOvcTCNumericField
 TOvcTCNumericField component

See also: properties, methods, events, hierarchy

Component Overview

The TOvcTCNumericField cell component encapsulates an Orpheus numeric field (TOvcNumericField) inside a cell.

The data that is displayed and edited by the numeric field cell component can be any of the supported numeric field data types. You have full control over the picture mask used for displaying and editing the data.


TOvcTCNumericField hierarchy


TOvcTCNumericField.CreateEntryField
CreateEntryField method

function TOvcTCNumericField.CreateEntryField(AOwner : TComponent) : TOvcBaseEntryField; override;

CreateEntryField creates an editing control based on a numeric field.

See also: TOvcTCBaseEntryField.CreateEntryField


TOvcTCNumericField.DataType
DataType property

property TOvcTCNumericField.DataType : TNumericDataType

Default: nftLongInt

DataType determines what type of information can be displayed and edited by the cell.

The Paint, StartEditing, and StopEditing methods automatically do any necessary conversion from this type. However, you must ensure that the memory block pointed to by the Data pointer is a variable of the required type, otherwise memory overwrites can occur.


TOvcTCNumericField.PictureMask
PictureMask property

property TOvcTCNumericField.PictureMask : string

Default: '##########'

PictureMask determines which characters the field accepts and the character format.

The editing control for the cell will edit the data using this picture mask. The picture mask is also used indirectly by the Paint method when data is displayed in the cell.

See the TOvcNumericField component for information about picture masks for numeric fields.


TOvcTCNumericField.events
TOvcTCNumericField events

OnClick 	OnExit

OnChange	OnKeyDown

OnDblClick 	OnKeyPress

OnDragDrop 	OnKeyUp

OnDragOver 	OnMouseDown

OnEndDrag 	OnMouseMove

OnEnter 	OnMouseUp


TOvcTCNumericField.methods
TOvcTCNumericField methods

Assign	HasParent

AssignTo 	IncRefs

CanStopEditing	InheritsFrom

ChangeName 	InitInstance

ClassInfo	InsertComponent

ClassName	InstanceSize

ClassParent	Loaded

ClassType	MethodAddress

Create	MethodName

CreateEntryField	NewInstance

DecRefs	Notification

DefaultHandler	Paint

Destroy	ReadState

DestroyComponents	RemoveComponent

Destroying	ResolveAttributes

Dispatch	SendKeyToTable

EditHandle	SetDesigning

EditHide	SetName

EditMove	StartEditing

FieldAddress	StopEditing

FilterTableKey	TableWantsTab

FindComponent	ValidateRename

Free	WriteComponents

FreeInstance	WriteState


TOvcTCNumericField.properties
TOvcTCNumericField properties

Access	Margin

Adjust	MaxLength

BeepOnError	Name

CaretIns	Owner

CaretOvr  	PadChar

Color	PasswordChar

ComponentCount 	PasswordMode

ComponentIndex 	PictureMask

Components 	RangeHi

ComponentState 	RangeLo

ControlCharColor  	References

DataType	RightJustify

DecimalPlaces  	ShowHint

DesignInfo 	StripLiterals

Font	Table

ForceInsert  	TableColor

ForceOvertype  	TableFont

HighlightColors	Tag

Hint	TrimBlanks

InputRequired	UseASCIIZStrings

InsertPushes  	UseWordWrap


TOvcTCPictureField
 TOvcTCPictureField component

See also: properties, methods, events, hierarchy

Component Overview

The TOvcTCPictureField cell component encapsulates an Orpheus picture field (TOvcPictureField) inside a cell.

The data that is displayed and edited by the picture field cell component can be any of the supported picture field data types. The component is not restricted to just strings. You have full control over the picture mask used for displaying and editing the data.


TOvcTCPictureField hierarchy


TOvcTCPictureField.CreateEntryField
CreateEntryField method

function TOvcTCPictureField.CreateEntryField(AOwner : TComponent) : TOvcBaseEntryField; override;

CreateEntryField creates an editing control based on a picture field.

See also: TOvcTCBaseEntryField.CreateEntryField


TOvcTCPictureField.DataType
DataType property

property TOvcTCPictureField.DataType : TPictureDataType

Default: pftString

DataType determines what type of information can be displayed and edited by the cell.

The Paint, StartEditing, and StopEditing methods automatically do any necessary conversion from this type. However you must ensure that the memory block pointed to by the Data pointer is a variable of the required type, otherwise memory overwrites can occur.


TOvcTCPictureField.PictureMask
PictureMask property

property TOvcTCPictureField.PictureMask : string

Default: 'XXXXXXXXXXXXXXX'

PictureMask defines which characters the field accepts and the character format.

The editing control for the cell will edit the data using this picture mask. The picture mask is also used indirectly by the Paint method when data is displayed in the cell.

See the TOvcPictureField component for information about picture masks for picture fields.


TOvcTCPictureField.events
TOvcTCPictureField events

OnClick 	OnExit

OnChange	OnKeyDown

OnDblClick 	OnKeyPress

OnDragDrop 	OnKeyUp

OnDragOver 	OnMouseDown

OnEndDrag 	OnMouseMove

OnEnter 	OnMouseUp


TOvcTCPictureField.methods
TOvcTCPictureField methods

Assign	HasParent

AssignTo 	IncRefs

CanStopEditing	InheritsFrom

ChangeName 	InitInstance

ClassInfo	InsertComponent

ClassName	InstanceSize

ClassParent	Loaded

ClassType	MethodAddress

Create	MethodName

CreateEntryField	NewInstance

DecRefs	Notification

DefaultHandler	Paint

Destroy	ReadState

DestroyComponents	RemoveComponent

Destroying	ResolveAttributes

Dispatch	SendKeyToTable

EditHandle	SetDesigning

EditHide	SetName

EditMove	StartEditing

FieldAddress	StopEditing

FilterTableKey	TableWantsTab

FindComponent	ValidateRename

Free	WriteComponents

FreeInstance	WriteState


TOvcTCPictureField.properties
TOvcTCPictureField properties

Access	Margin

Adjust	MaxLength

BeepOnError	Name

CaretIns	Owner

CaretOvr	PadChar

Color	PasswordChar

ComponentCount 	PasswordMode

ComponentIndex 	PictureMask

Components 	RangeHi

ComponentState 	RangeLo

ControlCharColor	References

DataType	RightJustify

DecimalPlaces	ShowHint

DesignInfo 	StripLiterals

Font	Table

ForceInsert	TableColor

ForceOvertype	TableFont

HighlightColors	Tag

Hint	TrimBlanks

InputRequired	UseASCIIZStrings

InsertPushes	UseWordWrap


TOvcTCRowHead
 TOvcTCRowHead component

See also: properties, methods, events, hierarchy

Component Overview

The TOvcTCRowHead component is a simple descendant of the TOvcTCBaseString class, expressly designed for row headings. The component ignores all data passed to it and instead displays spreadsheet-like row numbers for the cell.

The first row after the locked rows has the heading '1', the next is '2', and so on.

The DefaultCell property of the first locked column can be set to an instance of this component, causing the first column to easily show the numbers of the rows.


TOvcTCRowHead hierarchy


TOvcTCRowHead.Create
Create constructor

constructor TOvcTCRowHead.Create(AOwner : TComponent);

Create makes an instance of a row heading cell component.

This constructor forces the Access property to otxReadOnly, UseASCIIZStrings to False, and UseWordWrap to False.


TOvcTCRowHead.Paint
Paint method

procedure TOvcTCRowHead.Paint(Canvas : TCanvas; RowNum : TRowNum; ColNum : TColNum; CellWidth, CellHeight : Integer; const CellAttr : TOvcCellAttributes; Data : Pointer); override;

Paint the row number in the cell.

This method ignores the Data pointer entirely, and instead generates a spreadsheet-like string to define the row number and passes it on to the inherited Paint method.

The cell gets the number of locked rows from its owning table. If RowNum is less than the locked number of rows, the inherited Paint method is called, passing exactly the same parameters except that a pointer to an empty string is passed for the Data pointer. The effect of this is that cells in locked rows do not display anything.

If RowNum is greater than or equal to the number of locked rows in the table, the method generates a string for that row by subtracting the number of locked rows from RowNum, adding 1, and then converting to a string. This algorithm means that the first row after the locked rows has the heading '1', the next is '2' and so on. The inherited Paint method is then called, passing exactly the same parameters except that the address of the generated string is passed for the Data pointer.


TOvcTCRowHead.ShowActiveRow
ShowActiveRow property

property TOvcTCRowHead.ShowActiveRow : Boolean

Default: False

ShowActiveRow indicates whether an arrow should be displayed for the active row.

If ShowActiveRow is True, a right arrow is displayed for the active row. If it is False, the row number is displayed for the active row.


TOvcTCRowHead.ShowNumbers
ShowNumbers property

property TOvcTCRowHead.ShowNumbers : boolean

Default: True

ShowNumbers determines whether row numbers are displayed or not.

If ShowNumbers is True then the row number passed to the Paint method is displayed in the cell. If False, the row number is not displayed. Use this property in conjunction with the ShowActiveRow property to have a locked column that just displays an arrow for the active row (i.e. ShowActiveRow is True, ShowNumbers is False).

See also: ShowActiveRow


TOvcTCRowHead.events
TOvcTCRowHead events

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp


TOvcTCRowHead.methods
TOvcTCRowHead methods

Assign	HasParent

AssignTo 	IncRefs

CanStopEditing	InheritsFrom

ChangeName 	InitInstance

ClassInfo	InsertComponent

ClassName	InstanceSize

ClassParent	Loaded

ClassType	MethodAddress

Create	MethodName

DecRefs	NewInstance

DefaultHandler	Notification

DefineProperties 	Paint

Destroy	ReadState

DestroyComponents	RemoveComponent

Destroying	ResolveAttributes

Dispatch	SendKeyToTable

EditHandle	SetDesigning

EditHide	SetName

EditMove	StartEditing

FieldAddress	StopEditing

FilterTableKey	TableWantsTab

FindComponent	ValidateRename

Free	WriteComponents

FreeInstance	WriteState


TOvcTCRowHead.properties
TOvcTCRowHead properties

Access  	Owner

Adjust	References

Color	ShowActiveRow

ComponentCount 	ShowHint

ComponentIndex 	ShowNumbers

Components 	Table

ComponentState 	TableColor

DesignInfo 	TableFont

Font	Tag

Hint  	UseASCIIZStrings

Margin	UseWordWrap

Name


TOvcTCSimpleField
 TOvcTCSimpleField component

See also: properties, methods, events, hierarchy

Component Overview

The TOvcTCSimpleField cell component encapsulates an Orpheus simple field (TOvcSimpleField) inside a cell.

The data that is displayed and edited by the simple field cell component can be any of the supported simple field data types. The component is not restricted to just strings. You have full control over the picture mask used for displaying and editing the data.


TOvcTCSimpleField hierarchy


TOvcTCSimpleField.CreateEntryField
CreateEntryField method

function TOvcTCSimpleField.CreateEntryField(AOwner : TComponent) : TOvcBaseEntryField; override;

CreateEntryField creates an editing control based on a simple field.

See also: TOvcTCBaseEntryField.CreateEntryField


TOvcTCSimpleField.DataType
DataType property

property TOvcTCSimpleField.DataType : TSimpleDataType

Default: sftString

DataType determines what type of information can be displayed and edited by the cell.

The Paint, StartEditing, and StopEditing methods automatically do any necessary conversion from this type. However, you must ensure that the memory block pointed to by the Data pointer is a variable of the required type, otherwise memory overwrites can occur.


TOvcTCSimpleField.PictureMask
PictureMask property

property TOvcTCSimpleField.PictureMask : Char

Default: pmAnyChar ('X')

PictureMask defines which characters the field accepts and the character format.

The editing control for the cell will edit the data using this picture mask. The picture mask is also used indirectly by the Paint method when data is displayed in the cell.

See the TOvcSimpleField component for information about picture masks for simple fields.


TOvcTCSimpleField.events
TOvcTCSimpleField events

OnClick 	OnExit

OnChange	OnKeyDown

OnDblClick 	OnKeyPress

OnDragDrop 	OnKeyUp

OnDragOver 	OnMouseDown

OnEndDrag 	OnMouseMove

OnEnter 	OnMouseUp


TOvcTCSimpleField.methods
TOvcTCSimpleField methods

Assign	HasParent

AssignTo 	IncRefs

CanStopEditing	InheritsFrom

ChangeName 	InitInstance

ClassInfo	InsertComponent

ClassName	InstanceSize

ClassParent	Loaded

ClassType	MethodAddress

Create	MethodName

CreateEntryField	NewInstance

DecRefs	Notification

DefaultHandler	Paint

Destroy	ReadState

DestroyComponents	RemoveComponent

Destroying	ResolveAttributes

Dispatch	SendKeyToTable

EditHandle	SetDesigning

EditHide	SetName

EditMove	StartEditing

FieldAddress	StopEditing

FilterTableKey	TableWantsTab

FindComponent	ValidateRename

Free	WriteComponents

FreeInstance	WriteState


TOvcTCSimpleField.properties
TOvcTCSimpleField properties

Access	Margin

Adjust	MaxLength

BeepOnError	Name

CaretIns	Owner

CaretOvr	PadChar

Color	PasswordChar

ComponentCount 	PasswordMode

ComponentIndex 	PictureMask

Components 	RangeHi

ComponentState 	RangeLo

ControlCharColor	References

DataType	RightJustify

DecimalPlaces	ShowHint

DesignInfo 	StripLiterals

Font	Table

ForceInsert	TableColor

ForceOvertype	TableFont

HighlightColors	Tag

Hint	TrimBlanks

InputRequired	UseASCIIZStrings

InsertPushes	UseWordWrap


TOvcTCString
 TOvcTCString component

See also: properties, methods, events, hierarchy

Component Overview

The TOvcTCString cell component is the simplest cell component that displays and edits strings. It uses an editing control descended from Delphi's TEdit control, so the control appears as a single line of text. If the string is longer than the cell's width, the edit control will scroll the text horizontally.


TOvcTCString hierarchy


TOvcTCString.AutoAdvanceChar
AutoAdvanceChar property

property TOvcTCString.AutoAdvanceChar : boolean

Default: False

AutoAdvanceChar determines what happens if the caret is at the end of the editing control and you enter another character.

If AutoAdvanceChar is True the editing control sends (via SendKeyToTable) a WM_KEYDOWN message to the table containing the VK_RIGHT virtual keystroke. The effect of this will be for the table

to stop editing the current cell and move the active cell right one column.

If AutoAdvanceChar is False, the caret remains where it is.

See also: AutoAdvanceLeftRight


TOvcTCString.AutoAdvanceLeftRight
AutoAdvanceLeftRight property

property TOvcTCString.AutoAdvanceLeftRight : boolean

Default: False

AutoAdvanceLeftRight determines what happens if the caret is at the end of the editing control and you enter a caret movement command.

There are two cases to consider when AutoAdvanceLeftRight is true. First is when the caret is at the beginning of the field and the user presses the left arrow key. In this case the editing control sends

(via SendKeyToTable) a WM_KEYDOWN message to the table containing the VK_LEFT virtual keystroke. The effect of this will be for the table to

stop editing the current cell and move the active cell left one column.

Second is when the caret is at the end of the field and the user presses the right arrow key. A similar action occurs with the effect that the table stops editing the current cell and moves the active

cell right one column.

If AutoAdvanceLeftRight is False in either of these two situations, the caret remains where it is.

See also: AutoAdvanceChar


TOvcTCString.CreateEditControl
CreateEditControl virtual method

function TOvcTCString.CreateEditControl(AOwner : TComponent) : TOvcTCStringEdit; virtual;

CreateEditControl creates an editing control based on TEdit.

This method is virtual so that you can override the creation of the editing control, usually so that you can replace the default control with a control instantiated from a descendent type. CreateEditControl creates an editing control and returns it as the function result. It is called from the StartEditing method.

For more information on the TOvcTCStringEdit type, see the source code for the OvcTCEdt unit.

See also: StartEditing


TOvcTCString.MaxLength
MaxLength property

property TOvcTCString.MaxLength : Integer

Default: 0

MaxLength is the maximum number of characters that can be edited in the cell.

The value of MaxLength is used to set the MaxLength property of the editing control when it is created in the StartEditing method. It does not, however, limit the number of characters that can be displayed in the cell.

Unlike the TEdit MaxLength property, the value 0 is not allowed and you must specify a positive value. For a TEdit control, a MaxLength value of 0 implies no limit to the number of characters that can be edited. The TOvcTCString component requires you to explicitly state the number of characters. For this reason, the default value is not acceptable and you must change it. If you do not change it, no characters will be saved by the StopEditing method (it saves up to MaxLength+1 bytes, that is the string characters plus the length byte or the null terminator).

The Data pointer that is passed to the StopEditing method must point to a variable that is at least MaxLength+1 bytes in size. If it is smaller, a memory overwrite will occur.

See also: StartEditing


TOvcTCString.StartEditing
StartEditing method

procedure TOvcTCString.StartEditing(RowNum : TRowNum; ColNum : TColNum; CellRect : TRect; const CellAttr : TOvcCellAttributes; Data : Pointer); override;

StartEditing creates the editing control for the cell.

StartEditing calls CreateEditControl to create the editing control and sets the properties so that the control can be displayed in the table at the correct position.

RowNum is the row number of the cell being edited and ColNum is its column number. CellRect is the rectangle of the cell with respect to the displayed table. CellAttr is a fully resolved set of attributes for the cell.

Data is a pointer to a string. If UseASCIIZStrings is True, the string is a null-terminated string. If UseASCIIZStrings is False, the string is a length-byte string.

See also: MaxLength, StopEditing, TOvcBaseTableCell.StartEditing, TOvcTCBaseString.UseASCIIZStrings


TOvcTCString.StopEditing
StopEditing method

procedure TOvcTCString.StopEditing(SaveValue : Boolean; Data : Pointer); override;

StopEditing saves the string and destroys the editing control.

If SaveValue is True, StopEditing saves the edited string back to the Data pointer.

StopEditing writes up to MaxLength+1 bytes to the Data pointer and you must ensure that the memory block is large enough. The string memory block pointed to by data must be at least MaxLength+1 bytes long (the string itself will have a length less than or equal to MaxLength). If the memory block is any smaller, the StopEditing method will cause a memory overwrite.

See also: MaxLength, StartEditing, TOvcBaseTableCell.StopEditing


TOvcTCString.events
TOvcTCString events

OnClick 	OnExit

OnChange	OnKeyDown

OnDblClick 	OnKeyPress

OnDragDrop 	OnKeyUp

OnDragOver 	OnMouseDown

OnEndDrag 	OnMouseMove

OnEnter 	OnMouseUp


TOvcTCString.methods
TOvcTCString methods

Assign	HasParent

AssignTo 	IncRefs

CanStopEditing	InheritsFrom

ChangeName 	InitInstance

ClassInfo	InsertComponent

ClassName	InstanceSize

ClassParent	Loaded

ClassType	MethodAddress

Create	MethodName

CreateEditControl	NewInstance

DecRefs	Notification

DefaultHandler	Paint

DefineProperties 	ReadState

Destroy	RemoveComponent

DestroyComponents	ResolveAttributes

Destroying	SendKeyToTable

Dispatch	SetDesigning

EditHandle	SetName

EditHide	StartEditing

EditMove	StopEditing

FieldAddress	TableWantsTab

FilterTableKey	ValidateRename

FindComponent	WriteComponents

Free	WriteState

FreeInstance


TOvcTCString.properties
TOvcTCString properties

Access	Margin

Adjust	MaxLength

AutoAdvanceChar	Name

AutoAdvanceLeftRight	Owner

Color	References

ComponentCount 	ShowHint

ComponentIndex 	Table

Components 	TableColor

ComponentState 	TableFont

DesignInfo 	Tag

Font	UseASCIIZStrings

Hint	UseWordWrap


TOvcTable
 TOvcTable component

See also: properties, events, methods, hierarchy

Component Overview

The TOvcTable component is the Orpheus table control. It is a grid-like component for displaying data that naturally falls into a row and column matrix (or tabular) format. The TOvcTable component is the controlling force behind the display and editing of data in the grid.

The table component assumes that rows are records and columns are fields within a record. The table itself does not display or edit data, since it delegates these processes to cell components. When you design a table, each column holds the cell component that will be used for that column. You must drop cell components onto the form (they are non-visual) and then attach each to its own column. Not only do cell components specify how the data is displayed and edited, but they also specify attributes like the background color and access.

Often tables have a locked row that is used for column headings at the top. Because this situation is so common, the table control has an explicit property called LockedRowsCell that holds a reference to a cell component that is used for painting the locked cells at the top of the columns.

By default the table has no cell components attached to it or to its columns. If you compile such a table (for example by dropping a table onto a blank form and then compiling the project), no data can be displayed in the grid.

The TOvcTable component does not store any user data itself. Every time a cell needs to be painted, an event is triggered and the OnGetCellData event is called. You must write a handler to provide data for the table before anything can be displayed.

The four basic steps in designing and creating a table are:

1.  Drop a TOvcTable component onto the form.

2.  Drop the required cell components for the field types onto the form. Also drop a cell component for the locked row(s) onto the form.

3.  Set the various properties for the cell components and for the table. Link the cell components to the columns (using the Columns property editor) and link the cell component to the LockedRowsCell property.

4.  Write an OnGetCellData handler. The handler receives a row and a column number, and must return a pointer to the relevant data (the data type is determined by the cell component for the cell).

Steps 1 to 3 are relatively easy to implement. Step 4, on the other hand, can be difficult and could require a caching scheme. The table examples show an extremely simple OnGetCellData handler that uses an in-memory array. The CustOrd example gives an example of using a caching sheme with the OvcTable.

A table consists of three areas: the locked cells, the normal cells, and the unused area. The locked cells stay fixed when the table scrolls. The locked cells along the left side do not change when the table scrolls left or right, and the locked cells along the top do not change when the table scrolls up or down. The normal cells are those in the main body of the table that display and edit the data. The unused area is any portion of the table that is not covered by either locked or normal cells.

The normal and locked cells are separated from each other by grid lines. You can specify different types of grid lines for locked and normal cells. The grid lines are drawn with the grid pens (objects of type TOvcGridPen) that are described in the table's GridPenSet property.

The grid lines in the locked area of the table serve as "handles" for resizing columns and rows. As you pass the mouse cursor over a grid line in the locked area, it changes shape to the appropriate resizing cursor. Click and drag to resize a column or row. This capability is always available at design time in the IDE, but can be turned off at run time.

One special cell appears in the normal area of the table. It is called the active cell and that is where editing takes place. It is distinguished from the other cells by three attributes. It has a special background color, a special font color (if applicable), and a special grid pen. The grid pen is used to draw a focus box around the active cell. As a further visual aid, the table uses different colors and a different grid pen when the table control has the focus and when it doesn't. The active cell can be moved around the table by clicking on a cell with the mouse or by use of the arrow keys and other cursor movement keys.

In design mode, you can reorder the columns in the table. Press <Shift> and click on the locked cell with the left button at the top of the column. The cursor changes to a drag cursor. Still pressing <Shift> and the left mouse button move the cursor over the column

after which you would like to move the selected column. Release the left button and <Shift> and the selected column will be dropped into place.


TOvcTable hierarchy


TOvcTable.Access
Access property

property TOvcTable.Access : TOvcTblAccess

TOvcTblAccess = (otxDefault, otxNormal, otxReadOnly, otxInvisible);

Default: otxNormal

Access determines the cell access rights.

If a cell component in the table has otxDefault as its Access property, then it will use this Access value.

The possible values for Access are:

otxDefault - The same as otxNormal.

otxNormal - The cell can be read and edited.

otxReadOnly - The cell can be read but not edited.

otxInvisible - The cell cannot be read or edited and is invisible (the cell is displayed as a blank rectangle in the background color).

See also: Adjust


TOvcTable.ActiveCol
ActiveCol property

property TOvcTable.ActiveCol : TColNum

Default: 1

ActiveCol is the column number of the active cell.

The column number must be between LockedCols and ColCount-1. If it is not, ActiveCol is set to LockedCols.

If you specify a hidden column, the next visible column is selected instead. If there is no next visible column, the previous visible column is selected.

See also: ActiveRow, ColCount, LockedCols, SetActiveCell


TOvcTable.ActiveRow
ActiveRow property

property TOvcTable.ActiveRow : TRowNum

Default: 1

ActiveRow is the row number of the active cell.

The row number must be between LockedRows and RowLimit-1. If it is not, ActiveRow is set to LockedRows.

If you specify a hidden row, the next visible row is selected instead. If there is no next visible row, the previous visible row is selected.

See also: ActiveCol, LockedRows, RowLimit, SetActiveCell


TOvcTable.Adjust
Adjust property

property TOvcTable.Adjust : TOvcTblAdjust

TOvcTblAdjust = (otaDefault, otaTopLeft, otaTopCenter, otaTopRight, otaCenterLeft, otaCenter, otaCenterRight, otaBottomLeft, otaBottomCenter, otaBottomRight);

Default: otaCenterLeft

Adjust defines where data is displayed in the cell.

If a cell component in the table has otaDefault as its Adjust property, then it uses this Adjust value.

The possible values for Adjust are:

otaDefault - The same as otaCenterLeft.

otaTopLeft - The data is displayed in the top left corner of the cell.

otaTopCenter - The data is centered horizontally at the top of the cell.

otaTopRight - The data is displayed in the top right corner of the cell.

otaCenterLeft - The data is centered vertically at the left of the cell.

otaCenter - The data is centered vertically and horizontally in the cell.

otaCenterRight - The data is centered vertically at the right of the cell.

otaBottomLeft - The data is displayed in the bottom left corner of the cell.

otaBottomCenter - The data is centered horizontally at the bottom of the cell.

otaBottomRight - The data is displayed in the bottom right corner of the cell.

See also: Access


TOvcTable.AllowRedraw
AllowRedraw run-time property

property TOvcTable.AllowRedraw : Boolean

Default: True

AllowRedraw controls when the table displays itself.

When AllowRedraw is False, the table will not paint itself. If you make numerous changes to the table, you should set AllowRedraw to False before making the changes and then set it to True when you are finished. Then the table repaints itself just once, at the end.

The AllowRedraw property is a cumulative property. You can set it to False as many times as you like, but you must then set it to True an equal number of times before the table will paint itself. You must ensure that the calls to set AllowRedraw to False are balanced by calls to set AllowRedraw to True. There is no method to interrogate the underlying counter. If the calls are not balanced, then the table will never paint itself.

AllowRedraw should not be published, and the value of AllowRedraw is not saved to the DFM file.


TOvcTable.BlockAccess
BlockAccess write-only property

property TOvcTable.BlockAccess : TOvcTblAccess

TOvcTblAccess = (otxDefault, otxNormal, otxReadOnly, otxInvisible);

BlockAccess sets the access properties for a block of cells.

BlockAccess is a write-only property (it isn't possible to read access properties for a block of cells because they could all be different). If you need to read the access property for a cell, use the Access matrix property of the Cells property.

The cell block is the rectangle defined by the BlockColBegin, BlockColEnd, BlockRowBegin, and BlockRowEnd properties. You must define the block of cells by setting these four properties and then set the BlockAccess property to the desired value. The table then applies the access value to all cells in the block.

To reset the access values for a block of cells, define the block and then set the BlockAccess value to otxDefault.

The defined block of cells is not changed by setting a value in this property.

See also: BlockAdjust, BlockColBegin, BlockColEnd, BlockRowBegin, BlockRowEnd


TOvcTable.BlockAdjust
BlockAdjust write-only property

property TOvcTable.BlockAdjust : TOvcTblAdjust

TOvcTblAdjust = (otaDefault, otaTopLeft, otaTopCenter, otaTopRight, otaCenterLeft, otaCenter, otaCenterRight, otaBottomLeft, otaBottomCenter, otaBottomRight);

BlockAdjust sets the adjustment properties for a block of cells.

BlockAdjust is a write-only property (it isn't possible to read adjustment properties for a block of cells because they could all be different). If you need to read the adjustment property for a cell, use the Adjust matrix property of the Cells property.

The cell block is the rectangle defined by the BlockColBegin, BlockColEnd, BlockRowBegin, and BlockRowEnd properties. You must define the block of cells by setting these four properties and then set the BlockAdjust property to the desired value. The table then applies the adjustment value to all cells in the block.

To reset the adjustment values for a block of cells, define the block and then set the BlockAdjust value to otaDefault.

The defined block of cells is not changed by setting a value in this property.

See also: BlockAccess, BlockColBegin, BlockColEnd, BlockRowBegin, BlockRowEnd


TOvcTable.BlockCell
BlockCell write-only property

property TOvcTable.BlockCell : TOvcTableCellBase

BlockCell sets the cell component for a block of cells.

BlockCell is a write-only property (it isn't possible to read the cell components for a block of cells because they could all be different). If you need to read the cell component for a cell, use the Cell matrix property of the Cells property.

The cell block is the rectangle defined by the BlockColBegin, BlockColEnd, BlockRowBegin, and BlockRowEnd properties. You must define the block of cells by setting these four properties and then set the BlockCell property to the desired value. The table then applies the cell component to all cells in the block.

To reset the cell component for a block of cells to that defined by the column(s), define the block and then set the BlockCell value to nil.

The defined block of cells is not changed by setting a value in this property.

See also: BlockColBegin, BlockColEnd, BlockRowBegin, BlockRowEnd


TOvcTable.BlockColBegin
BlockColBegin property

property TOvcTable.BlockColBegin : TColNum

Default: 0

BlockColBegin is the column of the top left corner of a block of cells.

The cell block is the rectangle defined by the BlockColBegin, BlockColEnd, BlockRowBegin, and BlockRowEnd properties. To use the BlockXxx write-only properties, you must first define a cell block by setting these four properties, and then set the BlockXxx property value.

If you set BlockColBegin to a higher value than BlockColEnd, then BlockColEnd is changed to the new value of BlockColBegin.

Note that the cell block is different than the selection block, which is described in the overview at the beginning of this chapter.

See also: BlockColEnd, BlockRowBegin, BlockRowEnd


TOvcTable.BlockColEnd
BlockColEnd property

property TOvcTable.BlockColEnd : TColNum

Default: 0

BlockColEnd is the column of the bottom right corner of a block of cells.

The cell block is the rectangle defined by the BlockColBegin, BlockColEnd, BlockRowBegin, and BlockRowEnd properties. To use the BlockXxx write-only properties, you must first define a cell block by setting these four properties, and then set the BlockXxx property value.

If you set BlockColEnd to a lower value than BlockColBegin, then BlockColBegin is changed to the new value of BlockColEnd.

Note that the cell block is different than the selection block, which is described in the overview at the beginning of this chapter.

See also: BlockColBegin, BlockRowBegin, BlockRowEnd


TOvcTable.BlockColor
BlockColor write-only property

property TOvcTable.BlockColor : TColor

BlockColor sets the background color for a block of cells.

BlockColor is a write-only property (it isn't possible to read the background colors for a block of cells because they could all be different). If you need to read the Color property for a cell, use the Color matrix property of the Cells property.

The cell block is the rectangle defined by the BlockColBegin, BlockColEnd, BlockRowBegin, and BlockRowEnd properties. You must define the block of cells by setting these four properties and then set the BlockColor property to the desired value. The table then applies the background color to all cells in the block.

To reset the background color for a block of cells, define the block and then set the BlockColor value to clTableColorDefault (a special constant defined in the OvcTCmmn unit).

See also: BlockColBegin, BlockColEnd, BlockRowBegin, BlockRowEnd


TOvcTable.BlockFont
BlockFont write-only property

property TOvcTable.BlockFont : TFont

BlockFont sets the font for a block of cells.

BlockFont is a write-only property (it isn't possible to read font for a block of cells because they could all be different).

The cell block is the rectangle defined by the BlockColBegin, BlockColEnd, BlockRowBegin, and BlockRowEnd properties. You must define the block of cells by setting these four properties and then set the BlockFont property to the desired value. The table then assigns the font to all cells in the block.

To reset the font for a block of cells to the one defined by the columns' DefaultCell, define the block and then set the BlockFont value to nil.

See also: BlockColBegin, BlockColEnd, BlockRowBegin, BlockRowEnd


TOvcTable.BlockRowBegin
BlockRowBegin property

property TOvcTable.BlockRowBegin : TRowNum

Default: 0

BlockRowBegin is the row of the top left corner of a block of cells.

The cell block is the rectangle defined by the BlockColBegin, BlockColEnd, BlockRowBegin, and BlockRowEnd properties. To use the BlockXxx write-only properties, you must first define a cell block by setting these four properties, and then set the BlockXxx property value.

If you set BlockRowBegin to a higher value than BlockRowEnd, then BlockRowEnd is changed to the new value of BlockRowBegin.

Note that the cell block is different than the selection block, which is described in the overview at the beginning of this chapter.

See also: BlockColBegin, BlockColEnd, BlockRowEnd


TOvcTable.BlockRowEnd
BlockRowEnd property

property TOvcTable.BlockRowEnd : TRowNum

Default: 0

BlockRowEnd is the row of the bottom right corner of a block of cells.

The cell block is the rectangle defined by the BlockColBegin, BlockColEnd, BlockRowBegin, and BlockRowEnd properties. To use the BlockXxx write-only properties, you must first define a cell block by setting these four properties, and then set the BlockXxx property value.

If you set BlockRowEnd to a lower value than BlockRowBegin, then BlockRowBegin is changed to the new value of BlockRowEnd.

Note that the cell block is different than the selection block, which is described in the overview at the beginning of this chapter.

See also: BlockColBegin, BlockColEnd, BlockRowBegin


TOvcTable.BorderStyle
BorderStyle property

property TOvcTable.BorderStyle : TBorderStyle

Default: bsSingle

BorderStyle determines the style used when drawing the border.

The possible values are bsSingle (a single line border is drawn around the component) or bsNone (no border line).

The TBorderStyle type is defined in the Delphi Controls unit.


TOvcTable.CalcRowColFromXY
CalcRowColFromXY method

function TOvcTable.CalcRowColFromXY(X, Y : Integer; var RowNum : TRowNum; var ColNum : TColNum) : TOvcTblRegion;

TOvcTblRegion = (otrInMain, otrInLocked, otrInUnused, otrOutside);

CalcRowColFromXY returns the cell address for an XY coordinate.

Given an XY coordinate (for example from a mouse click), this method calculates the address of the cell and the region of the table corresponding to the coordinate. The XY coordinate is assumed to be client relative, which means that the top left pixel of the table is assumed to be at (0,0).


TOvcTable.Cells
Cells run-time read-only property

property TOvcTable.Cells: TOvcTableCells

Cells is the matrix of individual cell attributes.

This property gives you access to the individual cell matrix, and therefore to the individual attributes of each cell.


TOvcTable.ColCount
ColCount property

property TOvcTable.ColCount : Integer

Default: 10

ColCount is the number of columns in the table.

The columns are numbered from 0 to ColCount-1.

When the table is created, it creates an instance of TOvcTableColumns class (access to it is through the Columns property) passing a pointer to itself, and the default value of this property (i.e. 10). The only reason for automatically creating 10 columns is so that the columns are visible immediately in the Form Designer when a new table component is dropped onto a form.

When a new value is written to ColCount there are three possible cases. One, the new value is the same as the old, in which case nothing happens. Two, the new value is greater than the old, in which case the required number of columns (i.e. the difference between the old and new values) are created in the same manner as when the table is initially created. Three, the new value is less than the old value, in which case the surplus columns are disposed (the number being the difference between the old and new values).

See also: Columns, RowLimit


TOvcTable.ColOffset
ColOffset run-time read-only property

property TOvcTable.ColOffset[ColNum : TColNum] : Integer

ColOffset is an array of the starting offsets of the columns.

The ColOffset array enables you to find the starting offset of each column within the client area of the table. The offset is measured in pixels from the left edge of the client area (the first displayed column in the table has an offset of 0). If a column is not displayed when ColOffset is called, the returned value of the element is -1. To find out the numbers of columns that are displayed, use GetDisplayedColNums.

The ending offset of each displayed column is the starting offset of the next column. The ending offset of the last column is equal to the starting offset plus the column's width (use the Width array property of the Columns property).

See also: GetDisplayedColNums, RowOffset


TOvcTable.ColorUnused
ColorUnused property

property TOvcTable.ColorUnused : TColor

Default: clWindow

ColorUnused is the color which is used to paint the unused area of  the table

See also: Colors


TOvcTable.Colors
Colors property

property TOvcTable.Colors : TOvcTableColors

Colors is the set of colors used to paint cells.


TOvcTable.Columns
Columns property

property TOvcTable.Columns : TOvcTableColumns

Columns is the array of columns for the table.

Columns is an instantiated object of type TOvcTableColumns.

If you set the Columns property, the current internal columns object is freed and the internal columns object is set to point to the new columns object. After the assignment there is one copy of the column information, and so the source object cannot be disposed without affecting the table.

See also: Rows


TOvcTable.FilterKey
FilterKey method

function TOvcTable.FilterKey(var Msg : TWMKey) : TOvcTblKeyNeeds; virtual;

TOvcTblKeyNeeds = (otkDontCare, otkWouldLike, otkMustHave);

FilterKey is called from a cell to filter a keystroke.

For every keystroke entered into an editing control, its cell component calls this method of its owning table so that the table can filter the keystroke. The table returns the category of the keystroke as a value of type TOvcTblKeyNeeds.

If the return value is otkDontCare, the table is informing the cell (and its editing control) that it does not want to use this keystroke. The editing control can take any action on the key.

If the return value is otkWouldLike, the table would like this keystroke, but it is leaving the decision to the cell and the editing control. Keystrokes in this category are the arrow keys and the active cell movement keys. If, for example, the editing cell does not use the <Up> keystroke, it can let the table use it instead.

If the return value is otkMustHave, the table absolutely must have the keystroke. There are only two keystrokes in this category and both are used to terminate the cell editing session. <Esc> aborts the editing and <F2> saves the new data.

If the return value is otkDontCare or otkWouldLike, the cell component uses SendMessage to send a WM_KEYDOWN message containing this keystroke directly to the table.


TOvcTable.GetDisplayedColNums
GetDisplayedColNums method

procedure TOvcTable.GetDisplayedColNums(var NA : TOvcTableNumberArray);

GetDisplayedColNums returns an array of displayed column numbers.

The method is passed a TOvcTableNumberArray record structure and returns the structure filled in with the numbers of the currently displayed columns. GetDisplayedColNums makes no distinction between locked and normal columns; it returns the numbers of them all.

POvcTableNumberArray = ^TOvcTableNumberArray;

TOvcTableNumberArray = record

  NumElements : LongInt;      {number of elements in Number array}

  Count       : LongInt;      {return count of used elements in Number array}

  Number      : array [0..29] of LongInt; {Number array}

end;

Before calling GetDisplayedColNums, you must initialize the first field of the TOvcTableNumberArray (NumElements) to the number of elements available in the Number array field. For example, if you declare a TOvcTableNumberArray variable as a local variable, then the NumElements value should be set to 30. If, however, you allocate some memory on the heap for a possible 50 column numbers (i.e., GetMem(MyNumberArray, 52*sizeof(LongInt)), where MyNumberArray is a variable of type POvcTableNumberArray), then set NumElements to 50.

GetDisplayedColNums calculates the numbers of the displayed columns and puts them (in ascending order) in the Number array field of the structure. It uses the NumElements value to ensure that it doesn't write beyond the end of the array. It puts the actual number of displayed columns (including the partially displayed column on the right if there is one) in the Count field of the structure.

If the returned Count is less than or equal to NumElements, all of the column numbers were retrieved. If the returned Count is greater than NumElements, only the first NumElements column numbers were retrieved and Count is the actual number of displayed columns. You need to make another call with a larger structure to get all of the column numbers.

See also: GetDisplayedRowNums


TOvcTable.GetDisplayedRowNums
GetDisplayedRowNums method

procedure TOvcTable.GetDisplayedRowNums(var NA : TOvcTableNumberArray);

GetDisplayedRowNums returns an array of displayed row numbers.

The method is passed a TOvcTableNumberArray record structure and returns the structure filled in with the numbers of the currently displayed rows. GetDisplayedRowNums makes no distinction between locked and normal rows, it returns the numbers of them all.

POvcTableNumberArray = ^TOvcTableNumberArray;

TOvcTableNumberArray = record

  NumElements : LongInt;      {number of elements in Number array}

  Count       : LongInt;      {return count of used elements in Number array}

  Number      : array [0..29] of LongInt; {Number array}

end;

This method works just like GetDisplayedColNums, but refers to rows instead of columns.

See also: GetDisplayedColNums


TOvcTable.GridPenSet
GridPenSet property

property TOvcTable.GridPenSet : TOvcGridPenSet

GridPenSet is the set of grid pens used to draw the grid lines.


TOvcTable.HaveSelection
HaveSelection method

function TOvcTable.HaveSelection : Boolean;

HaveSelection returns True if there is a selection.

A selection is defined by an anchor cell in one corner and the active cell in the diagonally opposite corner. HaveSelection returns True if the selection's anchor cell does not equal the active cell.

See also: InSelection


TOvcTable.InEditingState
InEditingState method

function TOvcTable.InEditingState : boolean;

InEditingState is true if the active cell is being edited

This function gives a simple test to find out whether the table is currently in edit mode, i.e. that the active cell is being edited.

See also: StartEditingState, StopEditingState


TOvcTable.InSelection
InSelection method

function TOvcTable.InSelection(RowNum : TRowNum; ColNum : TColNum) : Boolean;

InSelection returns True if the specified cell is within the selection.

This method returns True if the specified cell falls within the rectangle of cells defined by the selection's anchor cell in one corner and the active cell in the diagonally opposite corner. If HaveSelection is True and you call InSelection for both the active cell and the anchor cell, True is returned for both.

If HaveSelection returns False, InSelection returns False for any cell.

See also: HaveSelection


TOvcTable.IncCol
IncCol method

function TOvcTable.IncCol(ColNum : TColNum; Direction : integer) : TColNum;

IncCol increments (or decrements) a column number

IncCol is a helpful internal routine used for calculating the number of the next or previous column to a passed column. ColNum is the reference column at which you start and Direction indicates whether you want the number of the next or previous column.

If Direction is a positive number, IncCol finds the next column along from ColNum that is in the main part of the table and is not hidden. If there is no such next column, then ColNum is returned as the function result. If there is such a column, its number will be returned as the function result.

If Direction is a negative number, IncCol finds the previous column before ColNum that is in the main part of the table and is not hidden. If there is no such previous column, then ColNum is returned as the function result. If there is such a column, its number will be returned as the function result.

If Direction is 0, IncCol verifies that ColNum is a column in the main part of the table and that it is not hidden. If it isn't, IncCol will search forwards looking for the next column that satisfies this condition. If it cannot find one, it will search backwards looking for the previous column that satisfies the same condition.

IncCol is used extensively in the internal table code, especially for operations such as moving the active cell right or left.

See also: IncRow


TOvcTable.IncRow
IncRow method

function TOvcTable.IncRow(RowNum : TRowNum; Direction : integer) : TRowNum;

IncRow increments (or decrements) a row number

IncRow is a helpful internal routine used for calculating the number of the next or previous row to a passed row. RowNum is the reference row at which you start and Direction indicates whether you want the number of the next or previous row.

If Direction is a positive number, IncRow finds the next row along from RowNum that is in the main part of the table and is not hidden. If there is no such next row, then RowNum is returned as the function result. If there is such a row, its number will be returned as the function result.

If Direction is a negative number, IncRow finds the previous row before RowNum that is in the main part of the table and is not hidden. If there is no such previous row, then RowNum is returned as the function result. If there is such a row, its number will be returned as the function result.

If Direction is 0, IncRow verifies that RowNum is a row in the main part of the table and that it is not hidden. If it isn't, IncRow will search forwards looking for the next row that satisfies this condition. If it cannot find one, it will search backwards looking for the previous row that satisfies the same condition.

IncCol is used extensively in the internal table code, especially for operations such as moving the active cell right or left.

See also: IncCol


TOvcTable.InvalidateCell
InvalidateCell method

procedure TOvcTable.InvalidateCell(RowNum : TRowNum; ColNum : TColNum);

InvalidateCell marks the cell as requiring repainting.

This method sets an internal flag to indicate that the cell needs repainting. The next time AllowRedraw is set to True, all invalid cells will be repainted.

See also: AllowRedraw, InvalidateColumn, InvalidateRow, InvalidateTable


TOvcTable.InvalidateColumn
InvalidateColumn method

procedure TOvcTable.InvalidateColumn(ColNum : TColNum);

InvalidateColumn marks the specified column as requiring repainting.

This method sets an internal flag to indicate that the specified column needs repainting (it makes a call to InvalidateCell for each cell in the column). The next time AllowRedraw is set to True, all invalid cells will be repainted.

See also: AllowRedraw, InvalidateCell, InvalidateRow, InvalidateTable


TOvcTable.InvalidateRow
InvalidateRow method

procedure TOvcTable.InvalidateRow(RowNum : TRowNum);

InvalidateRow marks the specified row as requiring repainting.

This method sets an internal flag to indicate that the specified row needs repainting (it makes a call to InvalidateCell for each cell in the row). The next time AllowRedraw is set to True, all invalid cells will be repainted.

See also: AllowRedraw, InvalidateCell, InvalidateColumn, InvalidateTable


TOvcTable.InvalidateTable
InvalidateTable method

procedure TOvcTable.InvalidateTable;

InvalidateTable marks the entire table as requiring repainting.

This method sets an internal flag to indicate that the entire table needs repainting (it makes a call to InvalidateCell for each cell in the table). The next time AllowRedraw is set to True, all invalid cells will be repainted.

See also: AllowRedraw, InvalidateCell, InvalidateColumn, InvalidateRow


TOvcTable.LeftCol
LeftCol property

property TOvcTable.LeftCol : TColNum

Default: 1

LeftCol is the number of the column on the left edge of the main table area.

The column number must be between LockedCols and ColCount-1. If it is not, LeftCol is set to LockedCols.

If you specify a hidden column, the next visible column is selected instead. If there is no next visible column, the previous visible column is selected.

See also: SetTopLeftCell, TopRow


TOvcTable.LockedCols
LockedCols property

property TOvcTable.LockedCols : TColNum

Default: 1

LockedCols is the number of fixed columns on the left side of the table.

The first LockedCols columns (from column 0 to LockedCols-1) are fixed; but the actual visible number of locked columns depends on whether any of these columns are hidden.

If the value used to set LockedCols is not in the range 0 to ColCount-1, LockedCols is not changed.

See also: LockedRows


TOvcTable.LockedRows
LockedRows property

property TOvcTable.LockedRows : TRowNum

Default: 1

LockedRows is the number of fixed rows at the top of the table.

The first LockedRows rows (from row 0 to LockedRows-1) are fixed; but the actual visible number of locked rows depends on whether any of these rows are hidden.

If the value used to set LockedRows is not in the range 0 to RowLimit-1, LockedRows is not changed.

See also: LockedCols


TOvcTable.LockedRowsCell
LockedRowsCell property

property TOvcTable.LockedRowsCell : TOvcTableCellBase

Default: none

LockedRowsCell is the cell component used for displaying locked rows.

Generally the columns in a table are different cell types. However, there is usually a locked row at the top of all the columns for headings, and these cells should be displayed with a different cell component. The LockedRowsCell property is a simple way to declare the cell component for the column headings.

You can declare individual locked cells to have different cell components.


TOvcTable.MoveActiveCell
MoveActiveCell virtual method

procedure TOvcTable.MoveActiveCell(Command : Word); virtual;

MoveActiveCell moves the active cell to the specified position.

The active cell is moved according to the Command parameter. MoveActiveCell forces the active cell to be visible, so the table is scrolled if required so that the new position of the active cell is visible.


TOvcTable.OnActiveCellChanged
OnActiveCellChanged event

property TOvcTable.OnActiveCellChanged : TCellNotifyEvent

TCellNotifyEvent = procedure(Sender : TObject; RowNum : TRowNum; ColNum : TColNum) of object;

OnActiveCellChanged defines an event handler that is called after the active cell changes.

The method assigned to the OnActiveCellChanged event is called with the new active column and row. For example, this event gives you an opportunity to update a status line.

It is a programming error to change the active cell within your event handler.

The following example displays the active cell in a label control in the form Rn:Cm where n is the row number and m the column number.

procedure TForm1.OvcTable1ActiveCellChanged(Sender: TObject; RowNum: LongInt;

                                            ColNum: Integer);

begin

  with Label1 do begin

    Caption := Format('R%d:C%d', [RowNum, ColNum]);

    Update;

  end;

end;


TOvcTable.OnActiveCellMoving
OnActiveCellMoving event

property TOvcTable.OnActiveCellMoving : TCellMoveNotifyEvent

TCellMoveNotifyEvent = procedure(Sender : TObject; Command : Word; var RowNum : TRowNum; var ColNum : TColNum) of object;

OnActiveCellMoving defines an event handler that is called just before the active cell is moved by user interaction.

The method assigned to the OnActiveCellMoving event is triggered by any user interaction that would move the active cell (for example pressing the up arrow on the keyboard or clicking on a cell with the mouse). The table calculates the new position of the active cell, and then triggers the event, passing the new address in the RowNum and ColNum parameters. This gives you an opportunity to change the new address of the active cell by altering the values of the RowNum and ColNum parameters (do not change the values of ActiveCol and ActiveRow to achieve this). When the event is triggered, ActiveCol and ActiveRow contain the old address of the active cell (where the active cell is moving from).

The Command parameter defines the Orpheus command that triggered the event. Its value is one of the ccXxx values defined in the OvcConst unit. For a mouse click or movement (when selecting), the value is ccMouse.

The following example makes column 5 unselectable, any attempt to move the active cell into column 5 will cause column 4 or 6 to be chosen instead. If the active cell is moving left, it is forced to go to column 4. If the active cell is moving right, it is forced to go to column 6. If the active cell is moved by the mouse, it is forced to column 6.

procedure TForm1.OvcTable1ActiveCellMoving(Sender: TObject; Command: Word;

                                           var RowNum: LongInt;

                                           var ColNum: Integer);

begin

  if (ColNum = 5) then

    case Command of

      ccLeft, ccPageLeft : ColNum := 4;

      ccRight, ccPageRight : ColNum := 6;

      ccMouse : ColNum := 6;

    end;{case}

end;


TOvcTable.OnBeginEdit
OnBeginEdit event

property TOvcTable.OnBeginEdit : TCellEditNotifyEvent

TCellEditNotifyEvent = procedure (Sender : TObject; RowNum : TRowNum; ColNum : TColNum; var AllowIt : boolean) of object;

OnBeginEdit defines an event handler that is called just before the table switches into edit mode for the active cell

The event is triggered for confirmation purposes: you are being asked to confirm that the active cell can be edited. Sender is generally the table control itself. The RowNum and ColNum parameters identify the cell that is about to be edited (they will equal ActiveRow and ActiveCol respectively).

The AllowIt parameter is True when the event handler is called. You an set it False if you do not want the active cell to be edited for

any reason.

See also: Access, OnDoneEdit, OnEndEdit


TOvcTable.OnClipboardCopy
OnClipboardCopy event

property TOvcTable.OnClipboardCopy : TNotifyEvent

OnClipboardCopy defines an event handler that is called when the user has requested a copy-to-clipboard operation

Since the table knows nothing about the data in the table (it does not store either the data or the displayable representation of the data), it cannot provide any meaningful action for a copy to clipboard request.

When the user issues a copy to clipboard request (either from a menu or from the keyboard) the table triggers the OnClipboardCopy event. Your event handler is responsible for working out the selected cells, the data in those cells, a clipboard format for those cells, and possibly a displayable representation of those cells.


TOvcTable.OnClipboardCut
OnClipboardCut event

property TOvcTable.OnClipboardCut : TNotifyEvent

OnClipboardCut defines an event handler that is called when the user has requested a cut-to-clipboard operation

Since the table knows nothing about the data in the table (it does not store either the data or the displayable representation of the data),

it cannot provide any meaningful action for a cut to clipboard request.

When the user issues a cut to clipboard request (either from a menu or from the keyboard) the table triggers the OnClipboardCut event. Your event handler is responsible for working out the selected cells, the data in those cells, a clipboard format for those cells, and possibly a displayable representation of those cells. You are also responsible for performing the 'delete' part of the cut request, i.e. actually removing the data from your internal database.


TOvcTable.OnClipboardPaste
OnClipboardPaste event

property TOvcTable.OnClipboardPaste : TNotifyEvent

OnClipboardPaste defines an event handler that is called when the user has requested a paste-from-clipboard operation

Since the table knows nothing about the data in the table (it does not store either the data or the displayable representation of the data),

it cannot provide any meaningful action for a paste to clipboard request.

When the user issues a paste from clipboard request (either from a menu or from the keyboard) the table triggers the OnClipboardPaste event. Your event handler is responsible for looking at the current contents of the clipboard, and whether a paste operation can take place. You are also responsible for performing the 'insert' part of the cut request, i.e. actually changing the data in your internal database to match that in the clipboard.


TOvcTable.OnDoneEdit
OnDoneEdit event

property TOvcTable.OnDoneEdit : TCellNotifyEvent

TCellEditNotifyEvent = procedure (Sender : TObject; RowNum : TRowNum; ColNum : TColNum) of object;

OnDoneEdit defines an event handler that is called just after the data has been saved from the edited cell

OnDoneEdit enables you to make any automatic saves to your database. At the time the method assigned to the OnDoneEdit event is triggered, the StopEditing method of the underlying cell component has already been called and the data saved.

See also: OnBeginEdit, OnEndEdit


TOvcTable.OnEndEdit
OnEndEdit event

property TOvcTable.OnEndEdit : TCellEditNotifyEvent

TCellEditNotifyEvent = procedure (Sender : TObject; RowNum : TRowNum; ColNum : TColNum; var AllowIt : boolean) of object;

OnEndEdit defines an event handler that is called just before the data in the editing control is saved

The method assigned to the OnEndEdit event is triggered for confirmation purposes: you are being asked to confirm that the newly edited data can be saved to the active cell. Sender is generally the table control itself. The RowNum and ColNum parameters identify the cell that is has been edited (they will equal ActiveRow and ActiveCol respectively).

The AllowIt parameter is True when the event handler is called. You can set it False if you want the active cell to continue to be edited for any reason. The event is triggered after the CanStopEditing method for the underlying cell component has been called (and if this returns False, the event is not triggered) but before the StopEditing method.

See also: OnBeginEdit, OnDoneEdit


TOvcTable.OnEnteringColumn
OnEnteringColumn event

property TOvcTable.OnEnteringColumn : TColNotifyEvent

TColNotifyEvent = procedure(Sender : TObject; ColNum : TColNum) of object;

OnEnteringColumn defines an event handler that is called just before the table requests data for a new column.

When the table repaints itself, it displays cells in row order, and within each row in column order. For each new column, the table triggers the OnEnteringColumn event just prior to triggering the OnGetCellData event to warn you that it is about to request data for the new column. This is a good time to make sure that the data is in the cache before the request to read it occurs.

In the default table model, rows are records and columns are fields and it is assumed that entire records are read at once. Therefore, the OnEnteringColumn event is not that important (presumably the fields for the current record are already in the cache).

This event handler must not change any table properties that would cause the table to be repainted or change the active cell.

See also: OnEnteringRow, OnLeavingColumn


TOvcTable.OnEnteringRow
OnEnteringRow event

property TOvcTable.OnEnteringRow : TRowNotifyEvent

TRowNotifyEvent = procedure(Sender : TObject; RowNum : TRowNum) of object;

OnEnteringRow defines an event handler that is called just before the table requests data for a new row.

When the table repaints itself, it displays cells in row order, and within each row in column order. For each new row, the table triggers the OnEnteringRow event just prior to triggering the first OnGetCellData event to warn you that it is about to request data for the new row. This is a good time to make sure that the data is in the cache before the request to read it occurs.

In the default table model, rows are records and columns are fields and it is assumed that entire records are read at once. Therefore, the OnEnteringRow event is important in that it gives you the opportunity to make sure that the entire record is in memory or in the cache.

This event handler must not change any table properties that would cause the table to be repainted or change the active cell.

The following example uses the OnEnteringRow event handler to read a record from a flat file. This example is meant for illustrative purposes only. You should cache a set of records in memory rather than read the record from the file every time.

procedure TForm1.OvcTable1EnteringRow(Sender: TObject; var RowNum: LongInt);

begin

  if (RowNum >= OvcTable1.LockedRows) then begin

    Seek(F, RowNum - OvcTable1.LockedRows);

    Read(F, DatabaseRecord);

  end;

end;

F is assumed to be a file of some record type, and DatabaseRecord is a global instance of that record type. The call to the Seek procedure moves the file pointer to the required record. If you have 1 locked row, then you need to read record 0 when the event is triggered for row 1. You don't need to read a record for row 0, the locked row, because it is presumed to be column headings, for example.

See also: OnEnteringColumn, OnLeavingRow


TOvcTable.OnGetCellAttributes
OnGetCellAttributes event

property TOvcTable.OnGetCellAttributes : TCellAttrNotifyEvent

TCellAttrNotifyEvent = procedure(Sender : TObject; RowNum : TRowNum; ColNum : TColNum; var CellAttr : TOvcCellAttributes) of object;

OnGetCellAttributes defines an event handler that is called after the table calculates the default attributes for a cell.

When the table repaints itself, it displays cells in row order, and within each row in column order. For each cell, the table triggers the OnGetCellAttributes event just after calculating the default attributes for the cell, and just prior to calling the Paint method of the cell component that is in charge of repainting that cell. This event gives you the opportunity to make final adjustments to the attributes for the cell. The changes made in this event handler override all other attributes.

TOvcCellAttributes = record

  caAccess    : TOvcTblAccess;   {access rights}

  caAdjust    : TOvcTblAdjust;   {data adjustment}

  caColor     : TColor;          {background color}

  caFont      : TFont;           {text font}

  caFontColor : TColor;          {text color}

end;

The cell's address is given by RowNum and ColNum, and the default set of attributes is in the passed CellAttr record. Change the values of any of the fields in the CellAttr record to change the way the cell is displayed.

The font object in the CellAttr parameter was specially created for the TOvcCellAttributes record (and is deleted after the cell is painted). Changing it does not change any of the other fonts in the table and its internal classes. Therefore, you can change the font properties singly, or you can assign another font's properties in their entirety to this font by using the Assign method.

This event handler must not change any table properties that would cause the table to be repainted.

The following example ensures that all the cells on the main diagonal of the table (the row number equals the column number) are painted with a lime background.

procedure TForm1.OvcTable1GetCellAttributes(Sender: TObject; RowNum: LongInt;

                                            ColNum: Integer;

                                            var CellAttr: TOvcCellAttributes);

  begin

    if (Row = Col) then

      CellAttr.caColor := clLime;

  end;

See also: Access, Adjust, Color, Font


TOvcTable.OnGetCellData
OnGetCellData event

property TOvcTable.OnGetCellData : TCellDataNotifyEvent

TCellDataNotifyEvent = procedure(Sender : TObject; RowNum : TRowNum; ColNum : TColNum; var Data : Pointer) of object;

OnGetCellData defines an event handler that is called when the table needs the data for a cell.

The method assigned to the OnGetCellData event is called just before a cell is painted, just before a cell is edited, and just after the cell is edited.

When the table repaints itself, it displays cells in row order, and within each row in column order. For each cell, the table triggers the OnGetCellData event just prior to calling the Paint method of the cell component that is in charge of repainting that cell. The event handler must return a pointer to the data in the Data parameter. The cell address is given by the RowNum and ColNum parameters. The table's painting code passes the returned Data pointer directly to the cell component's Paint method.

When the user edits a cell, the table triggers an OnGetCellData event just prior to calling the StartEditing method of the cell component that is in charge of editing the cell. The event handler returns a pointer to the data and the cell address is given by RowNum and ColNum.

When the user finishes editing a cell, the table triggers an OnGetCellData event just prior to calling the StopEditing method of the cell component that is in charge of editing the cell. The event handler returns a pointer to a variable where the newly edited data can be saved. The cell address is given by RowNum and ColNum.

The cell component for the cell defines the type of data that is displayed in that cell. The returned Data parameter must point to a variable of the correct type for the cell component; no type checking occurs. For example, a TOvcTCString cell component requires a pointer to a string. If you pass a pointer to anything else, you will get some weird effects (the cell component assumes that the pointer points to a string).

If you do not provide an OnGetCellData event handler, no data will ever be displayed in the table at run time. All cells will be blank. You must provide an OnGetCellData event handler for every table.

Warning: This event handler must not change any table properties that would cause the table to be repainted.


TOvcTable.OnLeavingColumn
OnLeavingColumn event

property TOvcTable.OnLeavingColumn : TColNotifyEvent

TColNotifyEvent = procedure(Sender : TObject; ColNum : TColNum) of object;

OnLeavingColumn defines an event handler that is called just before the active column changes.

The method assigned to the OnLeavingColumn event is called just before the column number for the active cell changes. This gives you an opportunity to save data from the cache to disk or to send a message to say the active cell changed (if the current active cell was edited).

In the default table model, rows are records and columns are fields and it is assumed that entire records are being processed at once. Therefore, the OnLeavingColumn event is not that important (presumably changes will be saved when the active row changes, not every time the active column changes within the row).

When the active column is changed, the OnLeavingColumn event is triggered for the old column number before the OnEnteringColumn event is triggered for the new column number.

This event handler must not change any table properties that would cause the table to be repainted or change the active cell.

See also: OnEnteringColumn, OnLeavingRow


TOvcTable.OnLeavingRow
OnLeavingRow event

property TOvcTable.OnLeavingRow : TRowNotifyEvent

TRowNotifyEvent = procedure(Sender : TObject; RowNum : TRowNum) of object;

OnLeavingRow defines an event handler that is called just before the active row changes.

The method assigned to the OnLeavingRow event is called just before the row number for the active cell changes. This gives you an opportunity to save data from the cache to disk or send a message to say the active cell changed (if the current active cell was edited).

In the default table model, rows are records and columns are fields and it is assumed that entire records are being processed at once. Therefore, the OnLeavingRow event gives you an opportunity to save the record data back to disk.

When the active row is changed, the OnLeavingRow event is triggered for the old row number before the OnEnteringRow event is triggered for the new row number.

The event handler must not change any table properties that would cause the table to be repainted or change the active cell.

The following example uses the OnLeavingRow event handler to save the record to a flat file. F is assumed to be a file of some record type, and DatabaseRecord is a global instance of that record type. The call to the Seek procedure moves the file pointer to the required record. If you have 1 locked row, then you need to read record 0 when the event is triggered for row 1. You don't need to read a record for row 0, the locked row, because it is presumed to be column headings, for example. RowHasChanged is a routine that you must write to determine whether the record in row RowNum has changed. You could save a copy of the original version of the record in the OnEnteringRow event and compare the saved version to the one in Database Record.

procedure TForm1.OvcTable1LeavingRow(Sender: TObject; var RowNum: LongInt);

begin

  if (RowNum >= OvcTable1.LockedRows) and RowHasChanged then begin

    Seek(F, RowNum - OvcTable1.LockedRows);

    Write(F, DatabaseRecord);

  end;

end;

See also: OnEnteringRow, OnLeavingColumn


TOvcTable.OnLockedCellClick
OnLockedCellClick event

property TOvcTable.OnLockedCellClick : TCellNotifyEvent

TCellNotifyEvent = procedure(Sender : TObject; RowNum : TRowNum; ColNum : TColNum) of object;

OnLockedCellClick defines an event handler that is called when a locked cell is clicked.

One use for this event is to change the active cell so that the column matches the ColNum parameter or so that the row matches the RowNum parameter. This would mean that clicking on the column heading for column 5 would move the active cell to column 5.

Another use for this event is to select all the cells in the required row or column. This would mean that clicking on the heading for column 5 would cause the active cell to move to the topmost row for column 5 (generally the row number would be equal to LockedRows) and the selection anchor cell would move to the last row (i.e., RowLimit-1) for the same column.

The following example changes the color of the cells in a column when the locked cell at the top of the column is clicked. The locked columns are ignored. The color change is only applied if the default cell for the column is descended from TOvcTCBaseString.

procedure TForm1.OvcTable1LockedCellClick(Sender: TObject; RowNum: LongInt;

                                          ColNum: Integer);

var

  CellComponent : TOvcBaseTableCell;

begin

  with OvcTable1 do begin

    if (ColNum >= LockedCols) then begin

      AllowRedraw := false;

      CellComponent := Columns.DefaultCell[ColNum];

      if (CellComponent is TOvcTCBaseString) then

        with TOvcTCString(CellComponent) do

          if (Color = clLime) then

            Color := clSilver

          else

            Color := clLime;

      InvalidateColumn(ColNum);

      AllowRedraw := True;

    end;

  end;

end;


TOvcTable.OnPaintUnusedArea
OnPaintUnusedArea event

property TOvcTable.OnPaintUnusedArea : TNotifyEvent

OnPaintUnusedArea defines an event handler that is called when the table's unused area needs to be painted.

If no method is assigned to the OnPaintUnusedArea event, the default action is to fill the unused area with the background color for the table (the value of the Color property). If a method is assigned to the OnPaintUnusedArea event, it is responsible for painting the unused area. The default action will not occur.

The unused part of the table consists of any area to the right of the last column and below the last row. At any one time it is either not visible at all, only visible as a rectangle to the right of the displayed cells, only visible as a rectangle under the displayed cells, or visible both to the right and under the displayed cells (a mirror image L). By calling GetDisplayedColNums, GetDisplayedRowNums, ColOffset, and RowOffset you can determine the extent of the unused area.

Your event handler can display anything within the unused area. For example, you could hatch it or tile it with a bitmap (e.g., a logo).


TOvcTable.OnTopLeftCellChanged
OnTopLeftCellChanged event

property TOvcTable.OnTopLeftCellChanged : TCellNotifyEvent

TCellNotifyEvent = procedure(Sender : TObject; RowNum : TRowNum; ColNum : TColNum) of object;

OnTopLeftCellChanged defines an event handler that is called when the top left cell of the table changes.

The method assigned to the OnTopLeftCellChanged event is called with the new top column and row values. For example, this event gives you an opportunity to update a status line.

The top left cell is defined as the cell at the top left hand corner of the normal area of the table. In other words, it is the cell just below any locked rows and just to the right of any locked columns.

The event handler must not change any table properties that would cause the table to be repainted or change the active or top left cell.

The following example displays the top left cell in a label control in the form Rn:Cm where n is the row number and m the column number.

procedure TForm1.OvcTable1TopLeftCellChanged(Sender: TObject; RowNum: LongInt;

                                             ColNum: Integer);

begin

  with Label2 do begin

    Caption := Format('R%d:C%d', [RowNum, ColNum]);

    Update;

  end;

end;


TOvcTable.OnTopLeftCellChanging
OnTopLeftCellChanging event

property TOvcTable.OnTopLeftCellChanging : TCellChangeNotifyEvent

TCellChangeNotifyEvent = procedure (Sender : TObject; var RowNum : TRowNum; var ColNum : TColNum) of object;

OnTopLeftCellChanging defines an event handler that is called just before the top left cell is changed

The method assigned to the OnTopLeftCellChanging event is triggered just before the TopRow and/or LeftCol properties are to be changed. The new values of these two properties have been calculated and are passed as the RowNum and ColNum parameters respectively. You have the opportunity (as they are var parameters) to change the values of the new top row and left column. Do NOT change TopRow or LeftCol in your event handler (this will result in an infinite loop), instead change he values of RowNum and ColNum.

Note that the top left cell is generally changed to ensure that the active cell is visible. It is possible to change the values of RowNum and ColNum so that the active cell is no longer visible: this can be disconcerting to the user, and the table does NOT test for or correct this particular condition (as it has already tested for it when it calculated the new address for the top left cell).

If you alter the values of RowNum and ColNum, be aware that the table will ensure that the returned values are within the main part of the table and that the cell they reference is not hidden.

The following example shows a perverse example of an OnTopLeftCellChanging event handler: the top left cell is always forced to row 1 column 1 (assuming that there is one locked row and one locked column).

 procedure TForm1.OvcTable1TopLeftCellChanging(Sender: TObject;

   var RowNum: Longint; var ColNum: Integer);

 begin

   RowNum := OvcTable1.LockedRows;

   ColNum := OvcTable1.LockedCols;

 end;

See also: OnActiveCellMoving, OnTopLeftCellChanged


TOvcTable.OnUserCommand
OnUserCommand event

property TOvcTable.OnUserCommand : TUserCommandEvent

TUserCommandEvent = procedure(Sender : TObject; Command : Word) of object;

OnUserCommand defines an event handler that is called when a user-defined command is entered.

The method assigned to the OnUserCommand event is called when any user-defined commands that are defined for the table are detected.

This event handler can make any desired changes to the table (e.g., change the top left cell, change the active cell, insert or delete columns or rows).


TOvcTable.Options
Options property

property TOvcTable.Options : TOvcTblOptionSet

TOvcTblOption = (otoBrowseRow, otoNoRowResizing, otoNoColResizing, otoTabToArrow, otoEnterToArrow, otoAlwaysEditing);

TOvcTblOptionSet = set of TOvcTblOption;

Default: []

Options is a set of flags that determine the behavior of the table.

The possible values for Options are:

otoBrowseRow - The entire active row is highlighted (and selected) when viewing the table.

otoNoRowResizing - Rows cannot be resized at run time.

otoNoColResizing - Columns cannot be resized at run time.

otoTabToArrow - <Tab> is equivalent to the right arrow and <ShiftTab> is equivalent to the left arrow.

otoEnterToArrow - <Enter> is equivalent to the right arrow.

otoAlwaysEditing - The active cell is always forced to edit mode.

otoNoSelection - Cells cannot be selected at run-time with the mouse or keyboard.


TOvcTable.ProcessScrollBarClick
ProcessScrollBarClick virtual method

procedure TOvcTable.ProcessScrollBarClick(ScrollBar : TOvcScrollBar; ScrollCode : TScrollCode); virtual;

TOvcScrollBar = (otsbVertical, otsbHorizontal);

ProcessScrollBarClick processes a click on one of the scrollbars.

The ScrollBar parameter identifies which scrollbar was clicked (vertical or horizontal) and the ScrollCode parameter identifies the region of the scrollbar. The TScrollCode type is defined in the Delphi documentation.

The actions taken by each combination of ScrollBar and ScrollCode are described in the following table. Any combination that is not in the table is ignored (for example, the scEndScroll scroll code is ignored in any combination). The active cell is not changed by any of these actions.

otsbHorizontal, scLineUp - Scroll the table right one cell. This action is performed when the left arrow on the horizontal scrollbar is clicked. It scrolls the table right one cell, so that the leftmost column becomes the second column from the left.

otsbHorizontal, scLineDown - Scroll the table left one cell. This action is performed when the right arrow on the horizontal scrollbar is clicked. It scrolls the table left one cell, so that the second leftmost column becomes the leftmost column. If there are no new columns to display, the unused area gets larger.

otsbHorizontal, scPageUp - Scroll the table right one page. This action is performed when the left paging area on the horizontal scrollbar is clicked. It scrolls the table right one page, so that the leftmost column becomes the rightmost column (if possible).

otsbHorizontal, scPageDown - Scroll the table left one page. This action is performed when the right paging area on the horizontal scrollbar is clicked. It scrolls the table left one page, so that the rightmost column becomes the leftmost column. If there are no new columns to display, the unused area gets larger.

otsbVertical, scLineUp - Scroll the table down one cell. This action is performed when the up arrow on the vertical scrollbar is clicked. It scrolls the table down one cell, so that the top row becomes the second row from the top.

otsbVertical, scLineDown - Scroll the table up one cell. This action is performed when the down arrow on the vertical scrollbar is clicked. It scrolls the table up one cell, to show a new row (or rows) at the bottom of the table. If there are no new rows, the unused area gets larger.

otsbVertical, scPageUp - Scroll the table down one page. This action is performed when the upper paging area on the vertical scrollbar is clicked. It scrolls the table down one page, so that the top row becomes the lowest row (if possible).

otsbVertical, scPageDown - Scroll the table up one page. This action is performed when the lower paging area on the vertical scrollbar is clicked. It scrolls the table up one page, so that the lowest row becomes the topmost row. If there are no new rows to display, the unused area gets larger.


TOvcTable.ResolveCellAttributes
ResolveCellAttributes virtual method

procedure TOvcTable.ResolveCellAttributes(RowNum : TRowNum; ColNum : TColNum; var CellAttr : TOvcCellAttributes); virtual;

ResolveCellAttributes calculates the display attributes of the specified cell.

This method is called from the cell component as part of its ResolveAttributes method. When a cell needs to be painted (or edited), the table zeroes out a TOvcCellAttributes record structure and then calls the cell component's ResolveAttributes method. ResolveAttributes sets up the default values for the cell component in the TOvcCellAttributes record and then calls ResolveCellAttributes. The ResolveCellAttributes method calculates any special attributes for the cell (for example, if it is locked, selected, active, or has any special attributes set for it through the BlockXxx properties) and changes the record accordingly. Just before returning, it triggers an OnGetCellAttributes event, passing the record.

TOvcCellAttributes = record

  caAccess    : TOvcTblAccess;   {access rights}

  caAdjust    : TOvcTblAdjust;   {data adjustment}

  caColor     : TColor;          {background color}

  caFont      : TFont;           {text font}

  caFontColor : TColor;          {text color}

end;

ResolveCellAttributes should never need to be overridden, but is documented here just in case you need to change the default processing.

See also: OnGetCellAttributes


TOvcTable.RowLimit
RowLimit property

property TOvcTable.RowLimit : TRowNum

Default: 10

RowLimit is the number of rows allowed in the table.

You can change the value of RowLimit at any time to increase or decrease the number of rows that the table displays.

If you insert a row into the Rows property, RowLimit is incremented. If you delete a row from the Rows property, RowLimit is decremented.

If any rows are defined with any special properties and you decrease RowLimit so that those rows are excluded, the special properties are not discarded. Increasing RowLimit again will reveal them.

See also: ColCount


TOvcTable.RowOffset
RowOffset read-only property

property TOvcTable.RowOffset[RowNum : TRowNum] : Integer

RowOffset is an array of the starting offsets of the rows.

The RowOffset array enables you to find the starting offset of each row within the client area of the table. The offset is measured in pixels from the top edge of the client area (the first displayed row in the table has an offset of 0). If a row is not displayed when RowOffset is called, the returned value of the element is -1. To find out which rows are being displayed, use GetDisplayedRowNums.

The ending offset of each displayed row is the starting offset of the next row. The ending offset of the last row is equal to the starting offset plus the row height (use the Height array property of the Rows property).

See also: ColOffset, GetDisplayedRowNums


TOvcTable.Rows
Rows property

property TOvcTable.Rows : TOvcTableRows

Rows is the array of rows for the table.

Rows is an instantiated object of type TOvcTableRows.

If you set the Rows property, the current internal rows object is freed and the internal rows object is set to point to the new rows object. After the assignment there is only one copy of the row information, and so the source object cannot be disposed without affecting the table.

See also: Columns


TOvcTable.ScrollBars
ScrollBars property

property TOvcTable.ScrollBars : TScrollStyle

Default: ssBoth

ScrollBars determines whether the table displays scroll bars.

If the value of ScrollBars is set to ssNone, no scroll bars are shown. If it is sbVertical, only a vertical scroll bar is shown. If it is sbHorizontal, only a horizontal scroll bar is shown. If it is sbBoth, both a horizontal and vertical scroll bar are shown.

The TScrollStyle type is defined in the Delphi documentation.


TOvcTable.SelAnchorCol
SelAnchorCol property

property TOvcTable.SelAnchorCol : TColNum

Default: 1

SelAnchorCol is the column number of the anchor cell.

A cell selection is defined by the anchor cell in one corner and the active cell in the diagonally opposite corner. All cells between these two cells (inclusive) are selected (this means that the active cell is always selected).

SelAnchorCol is the column number of the selection's anchor cell. The row part of the anchor cell's address is defined by SelAnchorRow.

See also: SelAnchorRow


TOvcTable.SelAnchorRow
SelAnchorRow property

property TOvcTable.SelAnchorRow : TColNum

Default: 1

SelAnchorRow is the row number of the anchor cell.

A cell selection is defined by the anchor cell in one corner and the active cell in the diagonally opposite corner. All cells between these two cells (inclusive) are selected (this means that the active cell is always selected).

SelAnchorRow is the row number of the selection's anchor cell. The column part of the anchor cell's address is defined by SelAnchorCol.

See also: SelAnchorCol


TOvcTable.SetActiveCell
SetActiveCell method

procedure TOvcTable.SetActiveCell(RowNum : TRowNum; ColNum : TColNum);

SetActiveCell sets the active cell.

This method sets the active cell with just one call, rather than two calls to set the ActiveRow and ActiveCol properties.

See also: ActiveCol, ActiveRow


TOvcTable.SetAnchorCell
SetAnchorCell method

procedure TOvcTable.SetAnchorCell(RowNum : TRowNum; ColNum : TColNum);

SetAnchorCell sets the selection's anchor cell.

This method sets the selection's anchor cell with just one call, rather than two calls to set the SelAnchorRow and SelAnchorCol properties.

See also: SelAnchorCol, SelAnchorRow


TOvcTable.SetTopLeftCell
SetTopLeftCell method

procedure TOvcTable.SetTopLeftCell(RowNum : TRowNum; ColNum : TColNum);

SetTopLeftCell sets the cell at the top left corner of the main area of the table.

This method sets the cell at the top left corner with just one call, rather than two calls to set the TopRow and LeftCol properties.

See also: LeftCol, TopRow


TOvcTable.StartEditingState
StartEditingState method

function TOvcTable.StartEditingState : boolean;

StartEditingState starts editing the active cell

The method returns True if the table was switched into edit mode (or if it was already in edit mode). It returns False if the table could not be switched into edit mode for any reason.

Calling StartEditingState will perform several actions. If the table is already in editing mode, this method returns immediately with True. Otherwise the OnBeginEdit event is triggered. If OnBeginEdit returns True, the active cell is forced to be visible (if required), the current attributes for the active cell are calculated, and if the Access attribute so calculated is otaNormal the data pointer for the cell is obtained through the OnCellGetData event. The cell component's StartEditing method is then called to prepare the editing control for editing the cell's data. If all of these operations succeed, StartEditingState will return True and the table will be in editing mode; if any step fails (e.g., the cell's Access attribute is calculated as otaReadOnly) then False is returned instead and the table remains in browse mode.

See also: InEditingState, OnBeginEdit, OnGetCellData


TOvcTable.StopEditingState
StopEditingState method

function TOvcTable.StopEditingState(SaveValue : boolean) : boolean;

StopEditingState stops editing the active cell

The method returns True if the table was switched back into browse (or non-edit mode) or if it was already in browse mode. It returns False if the table could not be switched into browse mode for any reason.

SaveValue is True if the data in the editing control is to be saved, otherwise it is False (and the edited data is discarded).

Calling StopEditingState will perform several actions. If the table is already in a browse state, this method returns immediately with True. Otherwise the CanStopEditing method of the active cell's underlying cell component is called. If this returns True, the OnEndEdit event is triggered. If this returns True as well, the actual editing process is terminated. Firstly the data pointer for the active cell is requested through an OnGetCellData event, and this is passed to the cell component's StopEditing method. Finally the OnDoneEdit event is triggered. If any of the steps 'fails' (e.g., CanStopEditing returns False), StopEditingState will return immediately with False as the function result, and the table will remain in editing mode. If every step succeeds then this method will return True and the table will be switched to browse mode.

See also: InEditingState, OnDoneEdit, OnEndEdit


TOvcTable.TopRow
TopRow property

property TOvcTable.TopRow : TRowNum

Default: 1

TopRow is the number of the row at the top edge of the main table area.

The row number must be between LockedRows and RowLimit-1. If it is not, TopRow is set to LockedRows.

If you specify a hidden row, the next visible row is selected instead. If there is no next visible row, the previous visible row is selected.

See also: LeftCol, SetTopLeftCell


TOvcTable.events

TOvcTable events

OnActiveCellChanged	OnExit

OnActiveCellMoving	OnGetCellAttributes

OnBeginEdit	OnGetCellData

OnClick 	OnKeyDown

OnClipboardCopy	OnKeyPress

OnClipboardCut	OnKeyUp

OnClipboardPaste	OnLeavingColumn

OnDblClick	OnLeavingRow

OnDoneEdit	OnLockedCellClick

OnDragDrop	OnMouseDown

OnDragOver	OnMouseMove

OnEndDrag	OnMouseUp

OnEndEdit	OnPaintUnusedArea

OnEnter	OnTopLeftCellChanged

OnEnteringColumn	OnTopLeftCellChanging

OnEnteringRow	OnUserCommand


TOvcTable.methods
TOvcTable methods

AlignControls 	InitInstance

Assign	InSelection

AssignTo 	InsertComponent

BeginDrag	InsertControl

BringToFront	InstanceSize

Broadcast	Invalidate

CalcRowColFromXY	InvalidateCell

CanFocus	InvalidateColumn

ChangeName 	InvalidateRow

ChangeScale 	InvalidateTable

ClassInfo	IsControlMouseMsg

ClassName	KeyDown

ClassParent	KeyPress

ClassType	KeyUp

Click 	Loaded

ClientToScreen	MainWndProc

ContainsControl	MethodAddress

ControlAtPos	MethodName

Create	MouseDown

CreateHandle 	MouseMove

CreateParams	MouseUp

CreateSubClass 	MoveActiveCell

CreateWindowHandle 	NewInstance

CreateWnd	NotifyControls

DblClick 	Paint

DefaultHandler 	PaintControls

Destroy	PaintHandler

DestroyComponents	PaintWindow

DestroyHandle 	PaletteChanged

Destroying	Perform

DestroyWindowHandle 	ProcessScrollBarClick

DestroyWnd 	ReadState

DisableAlign	Realign

Dispatch	RecreateWnd

DoEnter 	Refresh

DoExit 	RemoveComponent

DoKeyDown 	RemoveControl

DoKeyPress 	Repaint

DoKeyUp 	ResolveCellAttributes

DragCanceled 	ScaleBy

Dragging	ScaleControls

EnableAlign	ScreenToClient

EndDrag	ScrollBy

FieldAddress	SelectFirst

FilterKey	SelectNext

FindComponent	SendToBack

FindNextControl 	SetActiveCell

Focused	SetAnchorCell

Free	SetBounds

FreeInstance	SetDesigning

GetClientOrigin 	SetFocus

GetClientRect 	SetName

GetDeviceContext 	SetParent

GetDisplayedColNums	SetTextBuf

GetDisplayedRowNums	SetTopLeftCell

GetPalette 	SetZOrder

GetTabOrderList	Show

GetTextBuf	ShowControl

GetTextLen	StartEditingState

HandleAllocated	StopEditingState

HandleNeeded	Update

HasParent 	UpdateBoundsRect

HaveSelection	ValidateRename

Hide	VisibleChanging

IncCol	WndProc

IncRow	WriteComponents

InEditingState	WriteState

InheritsFrom


TOvcTable.properties
TOvcTable properties

Access	DesignInfo

ActiveCol	DragCursor

ActiveRow	DragMode

Adjust	Enabled

Align	Font

AllowRedraw 	GridPenSet

BlockAccess 	Handle

BlockAdjust 	Height

BlockCell 	HelpContext

BlockColBegin 	Hint

BlockColEnd 	IsControl

BlockColor 	Left

BlockFont 	LeftCol

BlockRowBegin 	LockedCols

BlockRowEnd 	LockedRows

BorderStyle	LockedRowsCell

BoundsRect 	MouseCapture

Brush 	Name

Canvas 	Options

Caption  	Owner

Cells 	Parent

ClientHeight 	ParentColor

ClientOrigin 	ParentCtl3D

ClientRect 	ParentFont

ClientWidth 	ParentShowHint

ColCount 	PopupMenu

ColOffset 	RowLimit

Color	RowOffset

Colors	Rows

ColorUnused	ScrollBars

Columns	SelAnchorCol

ComponentCount 	SelAnchorRow

ComponentIndex 	ShowHint

Components 	Showing

ComponentState 	TabOrder

ControlCount 	TabStop

Controller	Tag

Controls 	Text

ControlState 	Top

ControlStyle 	TopRow

Ctl3D	Visible

Cursor	Width

DefWndProc  	WindowHandle


TOvcTableCells
TOvcTableCells class

See also: properties, methods, hierarchy

Class Overview

The TOvcTableCells class encapsulates a sparse matrix of individual cell attributes and objects. It is provided for tables that do not fit the "one row equals one record, one column equals one field" mold. To accommodate this more "freestyle" display, the table has a property called Cells that is an instance of the TOvcTableCells class. This class defines individual cell objects and cell attributes on a cell-by-cell basis. You can then define each cell individually without having to conform to the default cell for the column.

There is no design-time editor for the TOvcTableCells class, it is for run time use only.

In the TOvcTableCells properties and methods, a cell is identified by its row number (RowNum) and column number (ColNum).


TOvcTableCells hierarchy


TOvcTableCells.Access
Access run-time property

property TOvcTableCells.Access[RowNum : TRowNum; ColNum : TColNum] : TOvcTblAccess

Access is a matrix of cell access rights.

If no special access rights have been set for a cell, this property returns otxDefault. If special access rights have been set for a cell, you can clear them by setting the cell's Access property to otxDefault.

The following example sets the access rights for the cell at row 5, column 2 to otxReadOnly if they are currently set to otxNormal, otherwise the rights are set to otxNormal.

with OvcTable1.Cells do

  if Access[5,2] = otxNormal then

    Access[5,2] := otxReadOnly

  else

    Access[5,2] := otxNormal;

See also: TOvcBaseTableCell.Access


TOvcTableCells.Adjust
Adjust run-time property

property TOvcTableCells.Adjust[RowNum : TRowNum; ColNum : TColNum] : TOvcTblAdjust

Adjust is a matrix of data adjustment attributes.

If no special adjustment attribute has been set for a cell, this property returns otaDefault. If a special adjustment attribute has been set for a cell, you can clear it by setting the cell's Adjust property to otaDefault.

See also: TOvcBaseTableCell.Adjust


TOvcTableCells.Cell
Cell run-time property

property TOvcTableCells.Cell[RowNum : TRowNum; ColNum : TColNum] : TOvcBaseTableCell

Cell is a matrix of cell objects.

If no special cell object has been set for a cell, this property returns nil. If a special cell object has been set for a cell, you can clear it by setting the cell's Cell property to nil.

The display information in a special cell object is overridden by any special display information for that same cell. For example, assume the cell at row 1 column 1 has a special cell component that normally uses white as its background. If you also set the color for the cell to black (via the Color matrix property) then this will override the color in the cell object at run time and the cell will be displayed in black.

The following example creates a new cell component (an instance of TOvcTCString) and then sets the cell at row 15, column 4 to it.

MyCell := TOvcTCString.Create(Form1);

OvcTable1.Cells.Cell[15,4] := MyCell;


TOvcTableCells.Color
Color run-time property

property TOvcTableCells.Color[RowNum : TRowNum; ColNum : TColNum] : TColor

Color is a matrix of cell background colors.

If no special color has been set for a cell, this property returns clOvcTableColorDefault ($2FFFFFF, defined in OvcTCmmn). If a special color has been set for a cell, you can clear it by setting the cell's Color property to clOvcTableColorDefault. This color overrides any special color calculated due to the cell's position (for example, a locked cell).


TOvcTableCells.Font
Font run-time property

property TOvcTableCells.Font[RowNum : TRowNum; ColNum : TColNum] : TFont

Font is a matrix of cell fonts.

If no special font has been set for a cell, this property returns nil. If a special font has been set for a cell, you can clear it by setting the cell's Font property to nil.


TOvcTableCells.ResetCell
ResetCell method

procedure TOvcTableCells.ResetCell(RowNum : TRowNum; ColNum : TColNum);

ResetCell deletes any special display information for a cell.

After ResetCell is called, the cell is displayed according to the default cell object of the column. All special attributes for the cell (access, adjust, cell object, color and font) are destroyed.


TOvcTableCells.ResolveFullAttr
ResolveFullAttr method

procedure TOvcTableCells.ResolveFullAttr(RowNum : TRowNum; ColNum : TColNum; var SCA : TOvcSparseAttr);

ResolveFullAttr gets a cell's attributes from the sparse matrix.

This method is used internally by the table to get the full set of attributes for a cell. If no special attributes exist for the cell, default values are returned. This method exists because it is faster than separate accesses to the individual property arrays.

TOvcSparseAttr = record

  scaAccess : TOvcTblAccess;

  scaAdjust : TOvcTblAdjust;

  scaColor  : TColor;

  scaFont   : TFont;

  scaCell   : TOvcTableCellAncestor;

end;

See also: Access, Adjust, Cell, Color, Font


TOvcTableCells.Table
Table run-time read-only property

property TOvcTableCells.Table : TOvcTableAncestor

Table is the owning table for the cell matrix.

Table is a read-only property. A cell matrix can only belong to a single table, and it remains owned by that table until the table destroys it.


TOvcTableCells.methods
TOvcTableCells methods

ClassInfo	FreeInstance

ClassName	InheritsFrom

ClassParent	InitInstance

ClassType	InstanceSize

Create	MethodAddress

DefaultHandler	MethodName

Destroy	NewInstance

Dispatch	ResetCell

FieldAddress	ResolveFullAttr

Free


TOvcTableCells.properties
TOvcTableCells properties

Access 	Color

Adjust 	Font

Cell 	Table


TOvcTableColors
TOvcTableColors class

See also: properties, methods, hierarchy

Class Overview

The TOvcTableColors class encapsulates the colors used by the Orpheus table component to simplify the Object Inspector display in the Delphi IDE.


TOvcTableColors hierarchy


TOvcTableColors.ActiveFocused
ActiveFocused property

property TOvcTableColors.ActiveFocused : TColor

Default: clHighlight

ActiveFocused is the background color for the active cell when the table has the focus.


TOvcTableColors.ActiveFocusedText
ActiveFocusedText property

property TOvcTableColors.ActiveFocusedText : TColor

Default: clHighlightText

ActiveFocusedText is the font color for the active cell when the table has the focus.


TOvcTableColors.ActiveUnfocused
ActiveUnfocused property

property TOvcTableColors.ActiveUnfocused : TColor

Default: clHighlight

ActiveUnfocused is the background color for the active cell when the table does not have the focus.


TOvcTableColors.ActiveUnfocusedText
ActiveUnfocusedText property

property TOvcTableColors.ActiveUnfocusedText : TColor

Default: clHighlightText

ActiveUnfocusedText is the font color for the active cell when the table does not have the focus.


TOvcTableColors.Editing
Editing property

property TOvcTableColors.Editing : TColor

Default: clBtnFace

Editing is the background color for the active cell when it is being edited.


TOvcTableColors.EditingText
EditingText property

property TOvcTableColors.EditingText : TColor

Default: clWindowText

EditingText is the font color for the active cell when it is being edited.


TOvcTableColors.Locked
Locked property

property TOvcTableColors.Locked : TColor

Default: clBtnFace

Locked is the background color for locked cells.


TOvcTableColors.Selected
Selected property

property TOvcTableColors.Selected : TColor

Default: clHighlight

Selected is the background color for selected cells (except the active cell).


TOvcTableColors.SelectedText
SelectedText property

property TOvcTableColors.SelectedText : TColor

Default: clHighlightText

SelectedText is the font color for selected cells (except the active cell).


TOvcTableColors.methods
TOvcTableColors methods

Assign	Dispatch

AssignTo 	FieldAddress

ClassInfo	Free

ClassName	FreeInstance

ClassParent	InheritsFrom

ClassType	InitInstance

Create	InstanceSize

DefaultHandler	MethodAddress

DefineProperties 	MethodName

Destroy	NewInstance


TOvcTableColors.properties
TOvcTableColors properties

ActiveFocused	EditingText

ActiveFocusedText	Locked

ActiveUnfocused	Selected

ActiveUnfocusedText	SelectedText

Editing


TOvcTableColumn
TOvcTableColumn class

See also: properties, methods, hierarchy

Class Overview

The TOvcTableColumn class defines the attributes of a single column of a table. The three attributes for a column are width, whether it is hidden or not, and the default cell type. The default cell type defines how all of the fields in the column are displayed and edited.

A table's column objects are stored in an instance of a TOvcTableColumns class. The TOvcTable class creates an instance of a TOvcTableColumns class and publishes it as the Columns property.


TOvcTableColumn hierarchy


TOvcTableColumn.Create
Create constructor

constructor TOvcTableColumn.Create(ATable : TOvcTableAncestor);

Create a table column.

ATable is the table that will own this column object. A column can be owned by only one table. A column cannot be moved from one table to another. This link between table and column cannot be changed for the life of the column object.

See also: DefaultCell, Hidden, Width


TOvcTableColumn.DefaultCell
DefaultCell run-time property

property TOvcTableColumn.DefaultCell : TOvcBaseTableCell

Default: nil

DefaultCell is the cell that the column uses for displaying and editing data.

DefaultCell defines how the column is seen. The column uses the default cell to display and edit data in the column.

When the DefaultCell property is set, the current DefaultCell's reference count is decremented (if there is a current default cell) and the new DefaultCell's reference count is incremented (if it is non-nil). If the new value for the DefaultCell property is a cell that refers to another table object, then nothing happens.

See also: TOvcBaseTableCell.References


TOvcTableColumn.Destroy
Destroy destructor

destructor TOvcTableColumn.Destroy; virtual;

Destroy a column.

If the DefaultCell is non-nil, Destroy decrements the number of references for the cell (it does not destroy the cell), and then destroys the column instance.

See also: TOvcBaseTableCell.References


TOvcTableColumn.Hidden
Hidden  run-time property

property TOvcTableColumn.Hidden : Boolean

Default: False

Hidden indicates whether the column is hidden or visible.

If Hidden is True, the column is hidden from view. It still exists, but it is not shown. If a column is hidden, no data is requested for the default cell to display.


TOvcTableColumn.Table
Table run-time read-only property

property TOvcTableColumn.Table : TOvcTableAncestor

Table is the owner of the column.

Table is a read-only property set by the Create constructor. Once a column is created, you cannot change its owner.


TOvcTableColumn.Width
Width run-time property

property TOvcTableColumn.Width : Integer

Default: 150

Width is the width of the column in pixels.

The minimum value for Width is 5.


TOvcTableColumn.methods
TOvcTableColumn methods

AssignTo 	FieldAddress

ClassInfo	Free

ClassName	FreeInstance

ClassParent	InheritsFrom

ClassType	InitInstance

Create	InstanceSize

DefaultHandler	MethodAddress

DefineProperties 	MethodName

Destroy	NewInstance

Dispatch


TOvcTableColumn.properties
TOvcTableColumn properties

DefaultCell	Table

Hidden	Width


TOvcTableColumns
TOvcTableColumns class

See also: properties, methods, hierarchy

Class Overview

The TOvcTableColumns class is an array of all the columns for a table. Each of the elements of the array is an instance of a TOvcTableColumn. The array has a lower limit of zero and an upper limit that's returned by the Count function. The properties and methods perform range checks on column numbers and the operation is ignored if a column number is out of range.

Unlike the TOvcTableRows class where you can change the Limit property to change the number of rows, you can only change the number of columns in a TOvcTableColumns object by inserting or appending new columns or deleting existing columns.

The underlying data structure for the TOvcTableColumns class is a TList, which limits the maximum number of columns to 16384.


TOvcTableColumns hierarchy


TOvcTableColumns.Append
Append method

procedure TOvcTableColumns.Append(C : TOvcTableColumn);

Append adds a new column to the end of the array.

The new column number will be the current value of Count, and then Count is incremented by one. The column object C must have already been created.

If the column C has a different table owner than the column array, the operation is ignored.

The following example appends a new column to the end of the columns array.

{Columns is a property of the table}

MyColumn := TOvcTableColumn.Create(OvcTable1);

with MyColumn do begin

  Width := 60;

  DefaultCell := OvcTCString1;

end;

OvcTable1.Columns.Append(MyColumn);

See also: Delete, Insert


TOvcTableColumns.Clear
Clear method

procedure TOvcTableColumns.Clear;

Clear removes all of the columns from the columns array.

After Clear is called, Count is returned to zero. The column objects in the columns array are disposed, but the cell components referenced by their DefaultCell properties are not.


TOvcTableColumns.Count
Count property

property TOvcTableColumns.Count : Integer;

Count is the number of column objects in the columns array.

The elements in the array have indexes that range from 0 to Count - 1.

Reading this property returns the current number of column objects in the internal array. Writing the property will do one of three things. If the new value equals the current one, nothing is done. If the new value is greater than the old one, the required number of default column objects are created and appended to the internal array. If the new value is less than the current one, the required number of column objects are disposed.


TOvcTableColumns.Create
Create constructor

constructor TOvcTableColumns.Create(ATable : TOvcTableAncestor; ANumber : Integer);

Create a new columns array.

Create allocates a new array with ANumber columns. The DefaultCell property for all the columns is nil. ATable is the owner of the columns array and all of the automatically created columns.


TOvcTableColumns.DefaultCell
DefaultCell run-time property

property TOvcTableColumns.DefaultCell[ColNum : TColNum] : TOvcBaseTableCell

DefaultCell is an array of the default cells for the columns.

This array property provides a convenient way to access all of the default cells for the column objects.


TOvcTableColumns.Delete
Delete method

procedure TOvcTableColumns.Delete(ColNum : TColNum);

Delete a column object from the columns array.

The deleted column object is destroyed (although its default cell is not). Columns with an index greater than ColNum are moved up to replace the deleted column.

The following example deletes the sixth column from the columns array.

{Columns is a property of the table}

OvcTable1.Columns.Delete(5);

See also: Append, Insert


TOvcTableColumns.Destroy
Destroy destructor

destructor TOvcTableColumns.Destroy; virtual;

Destroy a columns array.

Destroy calls Clear and then disposes of the array.

See also: Clear


TOvcTableColumns.Exchange
Exchange method

procedure Exchange(ColNum1, ColNum2 : TColNum);

Exchange two column objects in the column array.

The two indexes specified by ColNum1 and ColNum2 must be in range for the array (i.e. not less than zero and less than the current value of Count for the array), and must not be equal. If so, the method swaps over the elements for ColNum1 and ColNum2. If not, nothing is done and in particular no exception is raised.


TOvcTableColumns.Hidden
Hidden run-time property

property TOvcTableColumns.Hidden[ColNum : TColNum] : Boolean

Hidden is an array of the visibility flags for the columns.

This array property provides a convenient way to access all of the Hidden properties for the column objects.


TOvcTableColumns.Insert
Insert method

procedure TOvcTableColumns.Insert(const ColNum : TColNum; C : TOvcTableColumn);

Insert a new column into the columns array.

The columns starting at ColNum are moved down one position to make room for the new column. The new column object should already have been created.

If the column C has a different table owner than the columns array or if ColNum is out of range, the operation is ignored.

The following example inserts a new sixth column in the columns array.

{Columns is a property of the table}

MyColumn := TOvcTableColumn.Create(OvcTable1);

with MyColumn do begin

  Width := 60;

  DefaultCell := OvcTCString1;

end;

OvcTable1.Columns.Insert(5, MyColumn);

See also: Append, Delete


TOvcTableColumns.List
List run-time property

property TOvcTableColumns.List[ColNum : TColNum] : TOvcTableColumn

List is the array of column objects.

If you try to set an element of the array to a column that has a different table owner than the columns array, the operation is ignored.


TOvcTableColumns.Table
Table run-time read-only property

property TOvcTableColumns.Table : TOvcTableAncestor

Table is the owner of the columns array.

Table is a read-only property whose value is set by the Create constructor. Once a column array is created, you cannot change its owner.


TOvcTableColumns.Width
Width run-time property

property TOvcTableColumns.Width[ColNum : TColNum] : Integer

Width is an array of the widths for the columns.

This array property provides a convenient way to access all of the widths for the column objects.


TOvcTableColumns.methods
TOvcTableColumns methods

Append	Exchange

ClassInfo	FieldAddress

ClassName	Free

ClassParent	FreeInstance

ClassType	InheritsFrom

Clear	InitInstance

Create	Insert

DefaultHandler	InstanceSize

Delete	MethodAddress

Destroy	MethodName

Dispatch	NewInstance


TOvcTableColumns.properties
TOvcTableColumns properties

Count 	List

DefaultCell 	Table

Hidden 	Width


TOvcTableRows
TOvcTableRows class

See also: properties, methods, hierarchy

Class Overview

TOvcTableRows is a class that holds all the styles for the rows in a table. There are two attributes that define a row's style: the row's height and whether it is hidden or not. At the simplest level, the TOvcTableRows class can be viewed as an array of row styles (this is, in fact, the List property). The rest of this section discusses the class in this manner. The array has a lower limit of zero and an upper limit that's defined by the Limit property. The properties and methods perform range checks on row numbers and an exception is raised if a row number is out of range.

TOvcTableRows encapsulates a sparse array (an instance of a TOvcSparseArray) to hold the style for each row. If there is no custom style for a row, it is assumed to be visible and have a default height. If the style for a row is changed from a custom style to be visible and have the default height, the class deletes the explicit row style for that row to minimize the total amount of memory required for the class.

Because the individual row styles are held in a TOvcSparseArray instance, you can specify individual characteristics only for the first 320,000 rows.

The table class (TOvcTable) creates a single instance of a TOvcTableRows class and interfaces it as a property called Rows.


TOvcTableRows hierarchy


TOvcTableRows.Append
Append method

procedure TOvcTableRows.Append(const RS : TRowStyle);

Append adds a new row style.

Append adds a row to the end of the rows array List. The added row has a number equal to the current value of Limit, and Limit is incremented by one.

PRowStyle = ^TRowStyle;

TRowStyle = record

  Height : Integer;

  Hidden : Boolean;

end;

To append a row with a default style, set RS.Height to -1 and RS.Hidden to False. However, it is easier to increment the Limit property.

See also: Limit


TOvcTableRows.Clear
Clear method

procedure TOvcTableRows.Clear;

Clear removes all of the explicit row styles.

After calling Clear, all rows have the same height (DefaultHeight) and are visible.


TOvcTableRows.Count
Count run-time read-only property

property TOvcTableRows.Count : TRowNum

Count is the number of rows with an explicit style.

Count is the number of rows that have a style that is not the default style.

See also: Limit


TOvcTableRows.DefaultHeight
DefaultHeight property

property TOvcTableRows.DefaultHeight : Integer

Default: 30

DefaultHeight is the height in pixels for all rows that do not have an explicit height.

See also: Height


TOvcTableRows.Delete
Delete method

procedure TOvcTableRows.Delete(RowNum : TRowNum);

Delete a row style.

The row style is removed from the array and rows below RowNum have their numbers decremented. Limit is reduced by one.

See also: Limit, Insert


TOvcTableRows.Exchange
Exchange method

procedure TOvcTableRows.Exchange(const RowNum1, RowNum2 : TRowNum);

Exchange switches the locations of two row styles.

After a call to this routine, RowNum1 will have RowNum2's style and vice versa.


TOvcTableRows.Height
Height run-time property

property TOvcTableRows.Height[RowNum : TRowNum] : Integer

Height is an array of row heights, one for each row.

The Height array property provides access to each row's height individually. The minimum value for a row height is 5.

See also: DefaultHeight


TOvcTableRows.Hidden
Hidden run-time property

property TOvcTableRows.Hidden[RowNum : TRowNum] : Boolean

Hidden is an array of flags that indicate whether each row is hidden or visible.

The Hidden array property provides access to each row's hidden attribute individually.


TOvcTableRows.Insert
Insert method

procedure TOvcTableRows.Insert(const RowNum : TRowNum; const RS : TRowStyle);

PRowStyle = ^TRowStyle;

Insert a new row style.

The row style is inserted into the array at RowNum and the rows at RowNum and below have their numbers incremented. Limit is incremented by one.

TRowStyle = record

  Height : Integer;

  Hidden : Boolean;

end;

To insert a row with a default style, set RS.Height to -1 and RS.Hidden to False.

See also: Append, Delete, Limit


TOvcTableRows.Limit
Limit property

property TOvcTableRows.Limit : TRowNum

Default: 10

Limit is the maximum number of rows.

Limit is the total number of rows that the object tracks. The table's RowLimit property reads and writes this value.

If you reduce Limit, the row styles between the new and old values are not lost or disposed of. If you later increase Limit, they will be available again.

Limit has a minimum value of 1.

See also: Count


TOvcTableRows.List
List run-time property

property TOvcTableRows.List[RowNum : TRowNum] : TRowStyle

List is the array of row styles.

The Height field of the returned TRowStyle value is the actual height of the row. If the row has the default style, this property returns DefaultHeight for Height.

TRowStyle = record

  Height : Integer;

  Hidden : Boolean;

end;

See also: DefaultHeight, Height, Hidden


TOvcTableRows.Reset
Reset method

procedure TOvcTableRows.Reset(RowNum : TRowNum);

Reset a row style to the default.

The row's style is set to the default state (visible and default height).

See also: List


TOvcTableRows.RowIsSpecial
RowIsSpecial run-time read-only property

property TOvcTableRows.RowIsSpecial [RowNum : TRowNum] : Boolean

RowIsSpecial is an array of flags that indicate whether a row has an explicit style.

RowIsSpecial is a read-only array property. If the row has an explicit style, the value of RowIsSpecial is True, otherwise it is False. The property is used by the table's streaming code to determine whether a row has any data to stream.


TOvcTableRows.methods
TOvcTableRows methods

Append	FieldAddress

ClassInfo	Free

ClassName	FreeInstance

ClassParent	InheritsFrom

ClassType	InitInstance

Clear	Insert

Create	InstanceSize

DefaultHandler	MethodAddress

Delete	MethodName

Destroy	NewInstance

Dispatch	Reset

Exchange


TOvcTableRows.properties
TOvcTableRows properties

Count 	Limit

DefaultHeight 	List

Height 	RowIsSpecial

Hidden


TOvcTextFileEditor
 TOvcTextFileEditor component

See also: properties, events, methods, hierarchy

Component Overview

Since a common use for the editor component is to edit the contents of an ASCII text file, a ready-made descendant of TOvcEditor, TOvcTextFileEditor, is provided. TOvcTextFileEditor provides a LoadFromFile method, which reads the contents of a text file and loads the text into the associated editor component by calling AppendPara. You can ask for a file to be read either when you create the TOvcTextFileEditor or later.

To edit a different file later on, simply call LoadFromFile again.

In addition to LoadFromFile, TOvcTextFileEditor provides several additional methods and properties beyond those it inherits from TOvcEditor.


TOvcTextFileEditor hierarchy


TOvcTextFileEditor.BackupExt
BackupExt property

property TOvcTextFileEditor.BackupExt : TExtStr

TExtStr = string[3];

Default: 'BAK'

BackupExt is the extension used when creating backup files.

This property determines the file extension used when creating a backup file for the file currently being edited.

See also: MakeBackup


TOvcTextFileEditor.FileName
FileName property

property TOvcTextFileEditor.FileName : string

Default: ''

FileName is the name of the edit file.

FileName is the file in the editor or the name of a file that will be loaded from disk. Changing FileName does not cause the file to be loaded, except at design time.

The following example loads a file into the text file editor.

FileName := 'C:\AUTOEXEC.BAT';

IsOpen := True;

See also: IsOpen


TOvcTextFileEditor.IsOpen
IsOpen property

property TOvcTextFileEditor.IsOpen : Boolean

Default: False

IsOpen indicates whether the file is open.

The IsOpen property determines if the file specified by the FileName property is open (i.e., being edited). Setting IsOpen to True causes the file specified by the FileName property to be loaded using the LoadFromFile method, deleting any text currently in the editor. Setting IsOpen to False deletes any existing text in the editor's text stream and resets the scroll bars.

File errors generate standard Delphi exceptions.

Caution: IsOpen does not check to see if the existing text was modified before deleting it. You must test the Modified property and save the file if necessary to prevent editing changes from being lost.

See also: FileName, LoadFromFile


TOvcTextFileEditor.LoadFromFile
LoadFromFile method

procedure TOvcTextFileEditor.LoadFromFile(const Name : string);

LoadFromFile loads a file into the text editor.

This method loads the entire contents of the file specified by Name into memory and redraws the editor component. If an error occurs, an appropriate exception is raised (see OnError). The FileName property is changed to Name and IsOpen is set to True.

The following example loads a file into the editor.

LoadFromFile('C:\AUTOEXEC.BAT');

See also: FileName, IsOpen, SaveToFile


TOvcTextFileEditor.MakeBackup
MakeBackup property

property TOvcTextFileEditor.MakeBackup : Boolean

Default: False

MakeBackup determines whether the text editor makes a backup file.

This property determines if the text file editor creates a backup file before saving the current editor's text. If MakeBackup is True, the existing disk file is renamed using BackupExt as the extension before the current contents of the editor are saved to disk.

See also: BackupExt


TOvcTextFileEditor.NewFile
NewFile method

procedure TOvcTextFileEditor.NewFile(const Name : string);

NewFile creates a new file.

NewFile does three things:

1. Calls DeleteAll to delete all existing text.

2. Calls ResetScrollBars to reset the scroll bars.

3. Assigns Name to the FileName property.

Although NewFile is typically called with an empty string as a parameter, it can also be called in lieu of LoadFromFile to edit a file that does not yet exist.

Caution: NewFile does not check to see if the existing text was modified before deleting it. You must test the Modified property and save the file if necessary to prevent editing changes from being lost.

The following example creates a new file if it does not already exist.

if (Length(SomeFileName) <> 0) and FileExists(SomeFileName) then

  LoadFromFile(SomeFileName)

else

  NewFile(SomeFileName);

See also: LoadFromFile, SaveToFile, TOvcEditor.Modified


TOvcTextFileEditor.SaveToFile
SaveToFile method

procedure TOvcTextFileEditor.SaveToFile(const Name : string);

SaveToFile saves the editor's text stream to a file.

This method saves the contents of the editor's text stream in the file specified by Name, then sets the Modified property to False.

If MakeBackup is True, SaveToFile creates a backup file (if appropriate) by renaming the existing file before saving. For example, if Name is 'SOMEFILE.TXT' and a file by that name already exists, the existing file is renamed to 'SOMEFILE.BAK' before the new 'SOMEFILE.TXT' is created. If a 'SOMEFILE.BAK' already exists, it is deleted. This assumes that BackupExt is set to its default of 'BAK'.

The following example saves the existing file using its current file name and then prepares the editor for a new file.

if Modified then

  SaveToFile(FileName);

NewFile('');

See also: BackupExt, LoadFromFile, MakeBackup


TOvcTextFileEditor.events
TOvcTextFileEditor events

OnClick	OnKeyDown

OnDblClick	OnKeyPress

OnDragDrop	OnKeyUp

OnDragOver	OnMouseDown

OnEndDrag	OnMouseMove

OnEnter	OnMouseUp

OnError	OnShowStatus

OnExit	OnUserCommand


TOvcTextFileEditor.methods
TOvcTextFileEditor methods

AlignControls 	Hide

AppendPara	InheritsFrom

Assign	InitInstance

AssignTo 	Insert

Attach	InsertComponent

BeginDrag	InsertControl

BringToFront	InstanceSize

Broadcast	Invalidate

CanFocus	IsControlMouseMsg

CanRedo	KeyDown

CanUndo	KeyPress

ChangeName 	KeyUp

ChangeScale 	LineToPara

ClassInfo	Loaded

ClassName	LoadFromFile

ClassParent	MainWndProc

ClassType	MethodAddress

Clear	MethodName

ClearMarker	MouseDown

Click 	MouseMove

ClientToScreen	MouseUp

ContainsControl	NewFile

ControlAtPos	NewInstance

CopyToClipboard	NotifyControls

CreateHandle 	PaintControls

CreateSubClass 	PaintHandler

CreateWindowHandle 	PaintWindow

CutToClipboard	PaletteChanged

DblClick 	ParaCount

DefaultHandler 	ParaToLine

DefineProperties 	PasteFromClipboard

DeleteAll	Perform

Destroy	ProcessCommand

DestroyComponents	ReadState

DestroyHandle 	Realign

Destroying	RecreateWnd

DestroyWindowHandle 	Redo

DestroyWnd 	Refresh

DisableAlign	RemoveComponent

Dispatch	RemoveControl

DoEnter 	Repaint

DoExit 	Replace

DoKeyDown 	ResetScrollBars

DoKeyPress 	SaveToFile

DoKeyUp 	ScaleBy

DragCanceled 	ScaleControls

ScreenToClient

Dragging	ScrollBy

EffectiveColumn	Search

EnableAlign	SelectAll

EndDrag	SelectFirst

FieldAddress	SelectNext

FindComponent	SendToBack

FindNextControl 	SetBounds

FlushUndoBuffer	SetCaretPosition

Focused	SetDesigning

Free	SetFocus

FreeInstance	SetMarker

GetCaretPosition	SetMarkerAt

GetClientOrigin 	SetName

GetClientRect 	SetParent

GetDeviceContext 	SetSelection

GetLine	SetText

GetMarkerPosition	SetTextBuf

GetPalette 	SetZOrder

GetPara	Show

GetPrintableLine	ShowControl

GetSelection	Undo

GetTabOrderList	Update

GetText	UpdateBoundsRect

GetTextBuf	UpdateControlState

GetTextLen	ValidateRename

GotoMarker	VisibleChanging

HandleAllocated	WndProc

HandleNeeded	WriteComponents

HasParent 	WriteState


TOvcTextFileEditor.properties
TOvcTextFileEditor properties

Align	LineLength

AutoIndent	Lines

BackupExt	MakeBackup

BorderStyle	Margin

BoundsRect 	Modified

Brush 	MouseCapture

ByteLimit	Name

Canvas  	NextEditor

Caption  	Owner

CaretIns	ParaLength

CaretOvr	ParaLengthLimit

ClientHeight 	ParaLimit

ClientOrigin 	ParaPointer

ClientRect 	Parent

ClientWidth 	ParentColor

Color	ParentCtl3D

ComponentCount 	ParentFont

ComponentIndex 	ParentShowHint

Components 	PopupMenu

ComponentState 	PrevEditor

ControlCount 	ReadOnly

Controller	ScrollBars

Controls 	ScrollBarsAlways

ControlState 	ScrollPastEnd

ControlStyle 	ShowBookmarks

Ctl3D	ShowHint

Cursor	Showing

DefWndProc  	TabOrder

DesignInfo 	TabSize

DragCursor	TabStop

DragMode	TabType

Enabled	Tag

FileName	Text

FirstEditor 	TextLength

FixedFont	Top

Font  	TopLine

Handle 	UndoBufferSize

Height	Visible

HelpContext	VisibleColumns

HideSelection	WantEnter

HighlightColors	WantTab

Hint	Width

InsertMode	WindowHandle

IsControl  	WordWrap

IsOpen	WrapAtLeft

Left	WrapColumn

LineCount


TOvcTextFileViewer
 TOvcTextFileViewer component

See also: properties, events, methods, hierarchy

Component Overview

Since a common use for the viewer control is to display the contents of an ASCII text file, a ready-made descendant of TOvcBaseViewer, TOvcTextFileViewer, is provided. TOvcTextFileViewer overrides GetLinePtr in order to respond to the viewer control's requests for lines of text, and it handles setting the LineCount property when a file is opened.

All you have to do is to tell the viewer control which file to read. This can be done either at design time or at run time by setting the FileName property. The value of the IsOpen property determines if the file is opened and read.

For a comprehensive example of how to use the TOvcTextFileViewer component, see the TEXTVIEW sample program.


TOvcTextFileViewer hierarchy


TOvcTextFileViewer.FileName
FileName property

property TOvcTextFileViewer.FileName : string

FileName is the name of the file to view.

FileName is the file in the viewer or the name of a file that will be loaded from disk. If IsOpen is True and you change FileName, the new file is automatically loaded.

The following example loads a file into the text file viewer.

OvcTextFileViewer1.FileName := 'C:\AUTOEXEC.BAT';

OvcTextFileViewer1.IsOpen := True;

See also: IsOpen


TOvcTextFileViewer.FileSize
FileSize run-time read-only property

property TOvcTextFileViewer.FileSize : LongInt

FileSize is the number of bytes in the open file.

If the file is closed, FileSize returns 0.

The following example opens a file and obtains the size of the file.

OvcTextFileViewer1.FileName := 'C:\AUTOEXEC.BAT';

OvcTextFileViewer1.IsOpen := True;

Size := OvcTextFileViewer1.FileSize;


TOvcTextFileViewer.IsOpen
IsOpen property

property TOvcTextFileViewer.IsOpen : Boolean

Default: False

IsOpen indicates whether the file is open.

The IsOpen property determines if the file specified by the FileName property is open (i.e., being viewed). Setting IsOpen to True causes the file specified by the FileName property to be loaded. Setting IsOpen to False removes any existing text in the viewer and resets the scroll bars.

File errors generate standard Delphi exceptions.

See also: FileName


TOvcTextFileViewer.events
TOvcTextFileViewer events

OnClick	OnKeyPress

OnDblClick	OnKeyUp

OnDragDrop	OnMouseDown

OnDragOver	OnMouseMove

OnEndDrag	OnMouseUp

OnEnter	OnShowStatus

OnExit	OnUserCommand

OnKeyDown


TOvcTextFileViewer.methods
TOvcTextFileViewer methods

ActualColumn	HandleAllocated

AlignControls 	HandleNeeded

Assign	HasParent

AssignTo 	Hide

BeginDrag	InheritsFrom

BringToFront	InitInstance

Broadcast	InsertComponent

CanFocus	InsertControl

ChangeName 	InstanceSize

ChangeScale 	Invalidate

ClassInfo	IsControlMouseMsg

ClassName	KeyDown

ClassParent	KeyPress

ClassType	KeyUp

ClearMarker	Loaded

Click 	MainWndProc

ClientToScreen	MethodAddress

ContainsControl	MethodName

ControlAtPos	MouseDown

CopyToClipboard	MouseMove

Create	MouseUp

CreateHandle 	NewInstance

CreateSubClass 	NotifyControls

CreateWindowHandle 	PaintControls

DblClick 	PaintHandler

DefaultHandler 	PaintWindow

DefineProperties 	PaletteChanged

Destroy	Perform

DestroyComponents	ReadState

DestroyHandle 	Realign

Destroying	RecreateWnd

DestroyWindowHandle 	Refresh

DestroyWnd 	RemoveComponent

DisableAlign	RemoveControl

Dispatch	Repaint

DoEnter 	ScaleBy

DoExit 	ScaleControls

DoKeyDown 	ScreenToClient

DoKeyPress 	ScrollBy

DoKeyUp 	Search

DragCanceled 	SelectAll

Dragging	SelectFirst

EffectiveColumn	SelectNext

EnableAlign	SendToBack

EndDrag	SetCaretPosition

FieldAddress	SetDesigning

FindComponent	SetFocus

FindNextControl 	SetMarker

Focused	SetMarkerAt

Free	SetName

FreeInstance	SetParent

GetCaretPosition	SetSelection

GetClientOrigin 	SetTextBuf

GetClientRect 	SetZOrder

GetDeviceContext 	Show

GetLine	ShowControl

GetMarkerPosition	Update

GetPalette 	UpdateBoundsRect

GetPrintableLine	ValidateRename

GetSelection	VisibleChanging

GetTabOrderList	WndProc

GetTextBuf	WriteComponents

GetTextLen	WriteState

GotoMarker


TOvcTextFileViewer.properties
TOvcTextFileViewer properties

Align	Height

BorderStyle	HelpContext

BoundsRect 	HighlightColors

Brush 	Hint

Canvas  	IsControl

Caption  	IsOpen

Caret	Left

CaretActualPos 	LineCount

CaretEffectivePos 	LineLength

ClientHeight 	Lines

ClientOrigin 	MarginColor

ClientRect 	MouseCapture

ClientWidth 	Name

Color	Owner

ComponentCount 	Parent

ComponentIndex 	ParentColor

Components 	ParentCtl3D

ComponentState 	ParentFont

ControlCount 	ParentShowHint

Controller	PopupMenu

Controls 	ScrollBars

ControlState 	ShowBookmarks

ControlStyle 	ShowHint

Ctl3D	Showing

Cursor	TabOrder

DefWndProc  	TabSize

DesignInfo 	TabStop

DragCursor	Tag

DragMode	Text

Enabled 	Top

ExpandTabs	TopLine

FileName	Visible

FileSize 	Width

FixedFont	WindowHandle

Font

Handle


TOvcTimerPool
 TOvcTimerPool component

See also: properties, events, methods, hierarchy

Component Overview

The TOvcTimerPool component provides all the functions of the standard TTimer component, plus the additional benefit of using only one Windows timer for up to 32767 timing events. The practical maximum number of timing events depends on how long it takes your application to service each timer notification.

Windows timers are a scarce system resource. Using more timers than is absolutely necessary can adversely impact not only your application but also other applications. If a timer is not available when a program needs one, it can either terminate gracefully or it can terminate in a manner that leaves Windows in an unstable state. You can reduce the chances of running out of timers by using a TOvcTimerPool rather than multiple timers.

TOvcTimerPool uses the concept of a timer trigger to perform the same function as the TTimer's OnTimer event. Many timer triggers can be serviced by one Windows timer and this is what allows the TOvcTimerPool to provide multiple timer notifications and still use only one Windows timer.

After adding a TOvcTimerPool component to your form, use it by making a call to the timer pool's Add method. The method name passed to Add is called when the trigger interval expires.

Triggers can repeat until they are canceled (use Add) or they can be fired only once and then automatically removed (use AddOneTime).


TOvcTimerPool hierarchy


TOvcTimerPool.Add
Add method

function TOvcTimerPool.Add(OnTrigger : TTriggerEvent; Interval : Word) : Integer;

TTriggerEvent = procedure(Sender : TObject; Handle : Integer; Interval : Word; ElapsedTime : LongInt) of object;

Add creates a timer trigger.

The returned value is a handle for the new timer trigger. It is used to reference this timer trigger when using other TOvcTimerPool properties and methods.

Trigger handles are usually generated sequentially, starting at 0, but you cannot always depend on this. For example, if 5 timer triggers are added, they get handles 0 through 4. If the timer trigger with handle 2 is then removed, the next timer trigger added will get handle 2.

If a method is assigned to the OnTrigger parameter, it is called every Interval milliseconds until the timer trigger is removed or disabled. The method assigned to the OnAllTriggers event is also called every Interval milliseconds. If nil is passed for the OnTrigger parameter, only the method assigned to the OnAllTriggers event is called. Interval is the trigger time in milliseconds.

The following example adds a timer trigger with an interval of 5000 milliseconds (5 seconds). SomeTriggerMethod and the method assigned to the OnAllTriggers event are called every 5 seconds.

H := OvcTimerPool.Add(SomeTriggerMethod, 5000);

See also: AddOneTime, Count, Enabled, OnAllTriggers, Remove


TOvcTimerPool.AddOneTime
AddOneTime method

function TOvcTimerPool.AddOneTime(OnTrigger : TTriggerEvent; Interval : Word) : Integer;

TTriggerEvent = procedure(Sender : TObject; Handle : Integer; Interval : Word; ElapsedTime : LongInt) of object;

AddOneTime creates a timer trigger for one-time use.

When the specified interval expires, the trigger is automatically removed. The returned value is a handle for the new timer trigger. It is used to reference this timer trigger when using other TOvcTimerPool properties and methods.

If a method is assigned to the OnTrigger parameter, it is called when the specified Interval expires. The method assigned to the OnAllTriggers event is also called when the specified Interval expires. If nil is passed for the OnTrigger parameter, only the method assigned to the OnAllTriggers event is called. Interval is the trigger time in milliseconds.

The following example adds a timer trigger with an interval of 1000 milliseconds (1 second). Since nil is passed for the OnTrigger parameter, only the method assigned to the OnAllTriggers event is called. The added trigger fires once, after 1000 milliseconds has elapsed, and then it is automatically removed.

H := OvcTimerPool.AddOneTime(nil, 1000);

See also: Add, Enabled, OnAllTriggers, Remove


TOvcTimerPool.Count
Count run-time read-only property

property TOvcTimerPool.Count : Integer

Count returns the total number of timer triggers.

The number returned by Count includes both enabled and disabled timers.


TOvcTimerPool.ElapsedTime
ElapsedTime run-time read-only property

property TOvcTimerPool.ElapsedTime[Handle : Integer] : LongInt

ElapsedTime returns the number of milliseconds since the timer trigger was added.

Handle is the value returned by Add or AddOneTime. A timer trigger's elapsed time cannot be reset unless the trigger is removed and then added again.

See also: Add, AddOneTime, ElapsedTimeSec


TOvcTimerPool.ElapsedTimeSec
ElapsedTimeSec run-time read-only property

property TOvcTimerPool.ElapsedTimeSec[Handle : Integer] : LongInt

ElapsedTimeSec returns the number of seconds since the timer trigger was added.

Handle is the value returned by Add or AddOneTime.

See also: Add, AddOneTime, ElapsedTime


TOvcTimerPool.Enabled
Enabled run-time property

property TOvcTimerPool.Enabled[Handle : Integer] : Boolean

Enabled determines whether the specified timer trigger is active.

If Enabled is True, the specified timer trigger is active and timer events are generated based on the timer trigger's interval. If Enabled is False, the timer trigger information is still maintained and updated, but no events are generated. Handle is the value returned by Add or AddOneTime.

A disabled timer trigger can be enabled by setting Enabled to True, or removed using Remove or RemoveAll.

See also: Add, AddOneTime, Remove, RemoveAll


TOvcTimerPool.Interval
Interval run-time property

property TOvcTimerPool.Interval[Handle : Integer] : Word

Interval determines the number of milliseconds between trigger notifications.

The trigger interval is initially set when the timer trigger is added, but can be changed by assigning a new interval to this property. Handle is the value returned by Add or AddOneTime.

The elapsed time for the timer is not reset when the interval is changed.

See also: Add, AddOneTime


TOvcTimerPool.OnAllTriggers
OnAllTriggers event

property TOvcTimerPool.OnAllTriggers : TTriggerEvent

TTriggerEvent = procedure(Sender : TObject; Handle : Integer; Interval : Word; ElapsedTime : LongInt) of object;

OnAllTriggers defines an event handler that is called for all trigger events.

The method assigned to the OnAllTriggers event is called for each trigger event. Handle identifies the trigger that fired, Interval is the interval (in milliseconds) assigned to this trigger, and ElapsedTime is the number of milliseconds since the trigger was created.

The following example shows how to create and respond to a timer trigger from within an OnAllTriggers event handler.

Trigger1 := OvcTimerPool.Add(nil, 500);

Trigger2 := OvcTimerPool.Add(nil, 2500);

...

procedure TForm1.AllTriggers(Sender : TObject; Handle : Integer;

                             Interval : Word; ElapsedTime : LongInt);

begin

  if Handle = Trigger1 then

    {do something because trigger 1 fired}

  if Handle = Trigger2 then

    {do something because trigger 2 fired}

end;

See also: OnTrigger


TOvcTimerPool.OnTrigger
OnTrigger event

property TOvcTimerPool.OnTrigger[Handle : Integer] : TTriggerEvent

TTriggerEvent = procedure(Sender : TObject; Handle : Integer; Interval : Word; ElapsedTime : LongInt) of object;

OnTrigger defines access to an array of trigger event handlers.

This indexed event allows you to assign trigger handlers (TTriggerEvent methods) for all timer triggers in the internal list. Handle is the value returned by either the Add or AddOneTime methods. Using OnTrigger with an invalid Handle index causes an EInvalidTriggerHandle exception to be raised.

The following example shows how to assign a method to a specific trigger.

Trigger1 := OvcTimerPool.Add(nil, 500);

Trigger2 := OvcTimerPool.Add(nil, 2500);

...

procedure TForm1.MyTrigger1EventHandler(Sender : TObject; Handle : Integer;

                                        Interval : Word; ElapsedTime : LongInt);

begin

  {do something because trigger 1 fired}

end;

...

procedure TForm1.MyTrigger2EventHandler(Sender : TObject; Handle : Integer;

                                        Interval : Word; ElapsedTime : LongInt);

begin

  {do something because trigger 2 fired}

end;

...

OnTrigger[Trigger1] := Form1.MyTrigger1EventHandler;

OnTrigger[Trigger2] := Form1.MyTrigger2EventHandler;

See also: Add, AddOneTime, OnAllTriggers


TOvcTimerPool.Remove
Remove method

procedure TOvcTimerPool.Remove(Handle : Integer);

Remove removes the specified timer trigger.

Handle is the value returned by Add or AddOneTime. When all timer triggers have been removed, the Windows timer is automatically destroyed. It is recreated when a new timer trigger is added.

The following example first adds and then removes a timer trigger.

Trigger1 := OvcTimerPool.Add(nil, 500);

...

OvcTimerPool.Remove(Trigger1);

See also: Add, AddOneTime, RemoveAll


TOvcTimerPool.RemoveAll
RemoveAll method

procedure TOvcTimerPool.RemoveAll;

RemoveAll removes all timer triggers and destroys the Windows timer.

See also: Remove


TOvcTimerPool.events
TOvcTimerPool events

OnAllTriggers	OnTrigger


TOvcTimerPool.methods
TOvcTimerPool methods

Add	HasParent

AddOneTime	InheritsFrom

Assign	InitInstance

AssignTo 	InsertComponent

ChangeName 	InstanceSize

ClassInfo	Loaded

ClassName	MethodAddress

ClassParent	MethodName

ClassType	NewInstance

Create	Notification

DefaultHandler	ReadState

DefineProperties 	Remove

Destroy	RemoveAll

DestroyComponents	RemoveComponent

Destroying	SetDesigning

Dispatch	SetName

FieldAddress	ValidateRename

FindComponent	WriteComponents

Free	WriteState

FreeInstance


TOvcTimerPool.properties
TOvcTimerPool properties

ComponentCount 	ElapsedTimeSec

ComponentIndex 	Enabled

Components 	Interval

ComponentState 	Name

Count 	Owner

DesignInfo 	Tag

ElapsedTime


TOvcTransfer
 TOvcTransfer component

See also: properties, methods, hierarchy

Component Overview

The TOvcTransfer component provides a mechanism to transfer data to and from the fields of a form using a single data structure instead of setting and retrieving each field's value individually.

The data structure used by TOvcTransfer corresponds to the data required by the components on the form. For example, if the form contains two Orpheus simple entry fields that are configured to edit Byte data types, the required data structure is a record containing two variables of type Byte.

Admittedly this is a simple case and setting or retrieving the value for two components is hardly justification for use of the transfer component. Consider a form containing 20 edit fields, a couple of listboxes, a combobox, a memo field, and an assortment of checkboxes and radio buttons. Setting and retrieving the data for this form is much more error prone and tedious.

This is where the TOvcTransfer component is most useful. One data structure and two method calls are all that is needed. The transfer component's property editor even generates the necessary data structure, transfer methods, and a shell for an initialization routine. All you have to do is paste them into your application.


TOvcTransfer hierarchy


TOvcTransfer.GetTransferBufferSize
GetTransferBufferSize method

function TOvcTransfer.GetTransferBufferSize(CNA : array of TComponent) : Word;

GetTransferBufferSize returns the size required for the transfer buffer.

Use of this routine is not required by the transfer component, but is recommended during design and testing to ensure that the transfer buffer is the correct size.

CNA is the component name array. It is a list of the components for which data will be transferred.

The following example gets the required transfer buffer size for a label and an edit component and then tests to see if it is the correct size before transferring the data to the form.

type

  TransferBufferRec = record

    LabelText : string;

    EditText  : string;

  end;

...

var

  MyTransferBuffer : TransferBufferRec;

...

Size := OvcTransfer1.GetTransferBufferSize([Label1, Edit1]);

if Size <> SizeOf(MyTransferBuffer) then

  raise Exception.Create('Invalid transfer buffer size')

else

  OvcTransfer1.TransferToForm([Label1, Edit1], MyTransferBuffer);

See also: TransferToForm


TOvcTransfer.TransferFromForm
TransferFromForm method

procedure TOvcTransfer.TransferFromForm(CNA : array of TComponent; var Data);

TransferFromForm transfers the data from the components to the data structure.

TransferFromForm transfers the data from each of the components listed in the component name array specified by CNA to the data structure specified by Data. Data must be the correct size or a memory overwrite can occur. Use GetTransferBufferSize to verify the size of the transfer buffer.

The following example transfers data from the form to MyTransferBuffer record.

OvcTransfer1.TransferFromForm([Label1, Edit1], MyTransferBuffer);

See also: GetTransferBufferSize, TransferToForm


TOvcTransfer.TransferToForm
TransferToForm method

procedure TOvcTransfer.TransferToForm(CNA : array of TComponent; const Data);

TransferToForm transfers data from the data structure to the components.

TransferToForm transfers the data from the data structure specified by Data to each of the components listed in the component name array specified by CNA. Data must be the correct size or a memory overread can result. Use GetTransferBufferSize to verify the size of the transfer buffer.

The following example transfers data from the MyTransferBuffer record to the specified components on the form.

OvcTransfer1.TransferToForm([Label1, Edit1], MyTransferBuffer);

See also: GetTransferBufferSize, TransferFromForm


TOvcTransfer.methods
TOvcTransfer methods

Assign	HasParent

AssignTo 	InheritsFrom

ChangeName 	InitInstance

ClassInfo	InsertComponent

ClassName	InstanceSize

ClassParent	Loaded

ClassType	MethodAddress

Create	MethodName

DefaultHandler	NewInstance

DefineProperties 	Notification

Destroy	ReadState

DestroyComponents	RemoveComponent

Destroying	SetDesigning

Dispatch	SetName

FieldAddress	TransferFromForm

FindComponent	TransferToForm

Free	ValidateRename

FreeInstance	WriteComponents

GetTransferBufferSize	WriteState


TOvcTransfer.properties
TOvcTransfer properties

ComponentCount 	DesignInfo

ComponentIndex 	Name

Components 	Owner

ComponentState 	Tag


TOvcUserData
TOvcUserData class

See also: methods, hierarchy

Class Overview

The TOvcUserData class serves three purposes. It defines the set of valid characters for an entry field's mask character. It defines the case-changing characteristics of the mask character. And it defines the meaning of the substitution characters (Subst1 through Subst8).

A global instance of the TOvcUserData class (named OvcUserData) is created automatically and used as the default UserData property value for all Orpheus entry field components.

Changing the properties of the global instance of TOvcUserData (OvcUserData), alters the behavior of all entry fields using the global instance. (By default, this is all entry fields.) If you do not want to change the behavior of all entry fields in your application, create a new instance of TOvcUserData, set properties to achieve the desired behavior, and then assign the new instance to the UserData property of the individual entry fields.


TOvcUserData hierarchy


TOvcUserData.ForceCase
ForceCase property

property TOvcUserData.ForceCase[Index : TForceCaseRange] : TCaseChange

TForceCaseRange = pmUser1..pmUser8;

TCaseChange = (mcNoChange, mcUpperCase, mcLowerCase, mcMixedCase);

Default: mcNoChange (for all eight array elements)

ForceCase determines whether the case of entered characters is changed.

This property sets the case changing state for the corresponding user-defined picture mask character. Valid values for Index are pmUser1 through pmUser8.

The possible values for ForceCase are:

mcNoChange - No change to the character entered.

mcUpperCase - Force upper case.

mcLowerCase - Force lower case.

mcMixedCase - Force mixed case (e.g., 'john jones' becomes 'John Jones').

The user-defined picture mask characters are:

pmUser1 = '1';

pmUser2 = '2';

pmUser3 = '3';

pmUser4 = '4';

pmUser5 = '5';

pmUser6 = '6';

pmUser7 = '7';

pmUser8 = '8';


TOvcUserData.SubstChars
SubstChars property

property TOvcUserData.SubstChars[Index : TSubstCharRange] : Char

TSubstCharRange = Subst1..Subst8;

Default: (no substitution)

SubstChars determines what characters are substituted for a user-defined substitution character at run time.

By default, all elements of this array are assigned their corresponding substitution character (SubstChars[Subst1] := Subst1, SubstChars[Subst2] := Subst2, and so on).

The user-defined substitution characters are:

Subst1 = #241;

Subst2 = #242;

Subst3 = #243;

Subst4 = #244;

Subst5 = #245;

Subst6 = #246;

Subst7 = #247;

Subst8 = #248;


TOvcUserData.UserCharSet
UserCharSet property

property TOvcUserData.UserCharSet[Index : TUserSetRange] : TCharSet

TUserSetRange = pmUser1..pmUser8;

TCharSet = set of Char;

Default: #0..#255 (for all eight array elements)

UserCharSet determines the characters allowed in the positions that use a user-defined mask character.

By default, all characters are allowed. To limit the allowed characters, assign a different set for one of the user-defined picture mask characters.


TOvcUserData.methods
TOvcUserData methods

ClassInfo	Free

ClassName	FreeInstance

ClassParent	InheritsFrom

ClassType	InitInstance

DefaultHandler	InstanceSize

Destroy	MethodAddress

Dispatch	MethodName

FieldAddress	NewInstance


TOvcVirtualListbox
 TOvcVirtualListbox component

See also: properties, events, methods, hierarchy

Component Overview

The TOvcVirtualListbox component is similar in appearance and behavior to Delphi's standard listbox control, but with TOvcVirtualListbox you can:

•  manage a virtually unlimited number of items, using a very small amount of memory

•  display rows using any combination of colors

•  display a header line at the top of the listbox

•  scroll horizontally in the listbox

•  set up to 128 tab positions

•  select multiple items

•  protect list items

The TOvcVirtualListbox can manage a virtually unlimited number of items because it does not store the items it displays. A special method is called when the TOvcVirtualListbox needs to update the display. This routine (an event handler) returns the display string corresponding to the requested row. You can even construct this string on demand in the event handler.


TOvcVirtualListbox hierarchy


TOvcVirtualListbox.AutoRowHeight
AutoRowHeight property

property TOvcVirtualListbox.AutoRowHeight : Boolean

Default: True

AutoRowHeight determines whether cell heights are adjusted automatically.

If AutoRowHeight is True, changes in the Font are detected and the height of the listbox rows is adjusted to be the same height as the selected font. If AutoRowHeight is False, no automatic adjustments are made.

If you change the RowHeight property, AutoRowHeight is set to False.

See also: RowHeight


TOvcVirtualListbox.BorderStyle
BorderStyle property

property TOvcVirtualListbox.BorderStyle : TBorderStyle

Default: bsSingle

BorderStyle is the style used when drawing the listbox border.

The possible values are bsSingle (a single line border is drawn around the component) or bsNone (no border line).

The TBorderStyle type is defined in the Delphi Controls unit.


TOvcVirtualListbox.Columns
Columns property

property TOvcVirtualListbox.Columns : Byte

Default: 255

Columns is the logical width, in characters, of the listbox.

Columns is used to set the horizontal scrolling limits. If you use a value less than the longest string displayed in the listbox, the horizontal scrolling distance is limited and part of some listbox items will not be visible. A value that is too large will allow horizontal scrolling beyond the end of the displayed list items.

See also: ScrollBars


TOvcVirtualListbox.Header
Header property

property TOvcVirtualListbox.Header : string

Header is the text displayed at the top of the listbox.

The string assigned to the Header property is displayed at the top of the listbox. If the listbox contains a horizontal scrollbar, the header is scrolled right and left along with the listbox items.

Entering text for this property automatically enables the header display and sets the ShowHeader property to True.

See also: ShowHeader


TOvcVirtualListbox.HeaderColor
HeaderColor property

property TOvcVirtualListbox.HeaderColor : TOvcColors

Default: clBtnText and clBtnFace

HeaderColor determines the colors used to display the header text and background.

The default color choices of clBtnText for the text color and clBtnFace for the background cause the header to be displayed using the standard button look.

See also: Header, ShowHeader


TOvcVirtualListbox.IntegralHeight
IntegralHeight property

property TOvcVirtualListbox.IntegralHeight : Boolean

Default: True

IntegralHeight indicates whether the listbox automatically resizes itself to display only complete list items.

If IntegralHeight is True, the listbox is resized so that partial rows are not displayed. If IntegralHeight is False, partial rows might be displayed.


TOvcVirtualListbox.ItemIndex
ItemIndex run-time property

property TOvcVirtualListbox.ItemIndex : LongInt

ItemIndex determines the currently selected listbox item.

ItemIndex contains -1 if no item is selected. ItemIndex contains the index of the listbox item that was selected last (i.e., the one that has the focus). Assigning a valid index value to ItemIndex causes that listbox item to be selected. The listbox is scrolled as necessary to make the newly selected item visible.

The valid range for ItemIndex is 0 through NumItems-1.

See also: MultiSelect, NumItems, TopIndex


TOvcVirtualListbox.MultiSelect
MultiSelect property

property TOvcVirtualListbox.MultiSelect : Boolean

Default: False

MultiSelect indicates whether multiple items can be selected.

If MultiSelect is True, one or more listbox items can be selected using the same techniques as for standard TListBox components. The OnIsSelected event must be assigned to a method that supplies the selected status of all items in the listbox. If an event is not assigned, the EOnSelectNotAssigned exception is generated at run time.

If MultiSelect is False, only one item can be selected at a time.

See also: OnIsSelected


TOvcVirtualListbox.NumItems
NumItems property

property TOvcVirtualListbox.NumItems : LongInt

Default: depends on the font and height of the listbox

NumItems is the actual number of items that the virtual listbox can process.

Set this property to the maximum number of items that the listbox will display. The virtual listbox element indexes are zero-based, therefore assigning a value of 10 to NumItems yields a valid index range of 0 to 9.


TOvcVirtualListbox.OnCharToItem
OnCharToItem event

property TOvcVirtualListbox.OnCharToItem : TCharToItemEvent

TCharToItemEvent = procedure(Sender : TObject; Ch : Char; var Index : LongInt) of object;

OnCharToItem defines an event handler that is called to provide character to index mapping.

The method assigned to OnCharToItem is called to provide notification of a key press and can optionally return a new item index. Ch contains the character that was entered and Index contains the index of the currently active list item. If you assign Index a value other than the currently selected index, it becomes the new active item.

The following example shows how to allow a user to enter a character, map the character to a listbox index, and return the results. If the listbox is displaying the letters of the alphabet and you press F, the listbox displays the 6th item (list index number 5).

procedure TForm1.OvcVirtualListbox1CharToItem(Sender: TObject; Ch: Char;

                                              var Index: LongInt);

var

  I : LongInt;

begin

  {using the character in Ch, select the corresponding index}

  {that you wish selected in the listbox}

  I := Ord('A') - Ord(Ch);

  if I >= 0 then

    Index := I;

  {simple mapping assumes 26 items in the listbox}

end;

...

OnCharToItem := Form1.OvcVirtualListBox1CharToItem;


TOvcVirtualListbox.OnClickHeader
OnClickHeader event

property TOvcVirtualListbox.OnClickHeader : THeaderClickEvent

THeaderClickEvent = procedure(Sender : TObject; Point : TPoint) of object;

OnClickHeader defines an event handler that is called when a mouse click occurs in the header area.

The method assigned to OnClickHeader is called to provide notification of a mouse click in the header area. Point contains the X and Y (screen-relative) position of the mouse.

The following example shows how to detect a mouse click in the header area of the listbox. In this example, if the mouse is clicked in the left half of the header one action is taken and if the mouse is clicked in the right half of the header another action is taken.

procedure TForm1.OvcVirtualListBox1ClickHeader(Sender : TObject;

                                               Point : TPoint);

var

  Pt : TPoint;

begin

  Pt := OvcVirtualListBox1.ScreenToClient(Point);

  if Pt.X < OvcVirtualListBox1.Width div 2 then

    {do something}

  else

    {do something else};

end;


TOvcVirtualListbox.OnGetItem
OnGetItem event

property TOvcVirtualListbox.OnGetItem : TGetItemEvent

TGetItemEvent = procedure(Sender : TObject; Index : LongInt; var ItemString : string) of object;

OnGetItem defines an event handler that is called to obtain the display string for the virtual listbox item.

ItemString is empty on entry. The event handler must assign the display string corresponding to Index to ItemString. If no method is assigned to this event, the listbox displays sample data in all rows. Therefore, you can't do much with the virtual listbox until you write and assign a method to this event.

The following example causes the listbox to display ten items. The text in the rows is 'Age = 2', 'Age = 5', etc.

NumItems := 10

const

  Ages : array[0..9] of Byte = (2,5,7,8,12,44,66,33,17,21);

procedure TForm1.OvcVirtualListBox1GetItem(Sender : TObject; Index : LongInt;

                                           var ItemString : OpenString);

begin

  ItemString := Format('Age = %d', [Ages[Index]]);

end;


TOvcVirtualListbox.OnGetItemColor
OnGetItemColor event

property TOvcVirtualListbox.OnGetItemColor : TGetItemColorEvent

TGetItemColorEvent = procedure(Sender : TObject; Index : LongInt; var FG, BG : TColor) of object;

OnGetItemColor defines an event handler that is called to return the colors used to draw the listbox elements.

The method assigned to OnGetItemColor is called to get the colors to use when drawing the listbox elements. On entry, FG and BG contain the default foreground and background colors and Index is the index of the item to be drawn. Set FG and BG to the desired colors for the array element specified by Index.

The following example causes the virtual listbox to display the text of every other array element in red.

procedure Form1.OvcVirtualListBox1GetItemColor(Sender : TObject;

                                               Index : LongInt;

                                               var FG, BG : TColor);

begin

  if Odd(Index) then

    FG := clRed;

end;


TOvcVirtualListbox.OnGetItemStatus
OnGetItemStatus event

property TOvcVirtualListbox.OnGetItemStatus : TGetItemStatusEvent;

TGetItemStatusEvent = procedure(Sender : TObject; Index : LongInt; var Protect : Boolean) of object;

OnGetItemStatus defines an event handler that is called to determine the protected status of the listbox items.

The method assigned to OnGetItemStatus is called to determine if the listbox item specified by Index is protected. A protected listbox item cannot be selected and is displayed using the colors specified by the ProtectColor property. If no event handler is assigned, no items can be protected.

Set Protect to True to protect the item specified by Index. Set Protect to False to unprotect the item specified by Index.

See also: ProtectColor


TOvcVirtualListbox.OnIsSelected
OnIsSelected event

property TOvcVirtualListbox.OnIsSelected : TIsSelectedEvent

TIsSelectedEvent = procedure(Sender : TObject; Index : LongInt; var Selected : Boolean) of object;

OnIsSelected defines an event handler that is called to determine the item selection status.

If multiple selection is enabled (MultiSelect is True) and a method is assigned to OnIsSelected, the virtual listbox calls the assigned method to get the selection status of the element specified by Index. If the method sets Selected to True, the item will then be displayed using the colors specified by the SelectColor property.

The following example causes the virtual listbox to display every other list element as selected.

var

  I : Integer;

  SelectStatus : array[0..99] of Boolean;

...

NumItems := 100;

for I := 0 to 99 do

  SelectStatus[I] := Odd(I);

...

procedure TForm1.OvcVirtualListbox1IsSelected(Sender : TObject; Index : LongInt;

                                              var Selected : Boolean);

begin

  Selected := SelectStatus[Index];

end;

See also: MultiSelect, SelectColor


TOvcVirtualListbox.OnSelect
OnSelect event

property TOvcVirtualListbox.OnSelect : TSelectEvent

TSelectEvent = procedure(Sender : TObject; Index : LongInt; Selected : Boolean) of object;

OnSelect defines an event handler that is called to provide notification of a selection change.

Index contains the listbox item index. Selected is True if the item corresponding to Index is selected and False if the item was selected and is being unselected.

The following example causes the computer to generate a single beep when a new item is selected and two beeps when an item is unselected.

procedure TForm1.OvcVirtualListbox1Select(Sender : TObject; Index : LongInt;

                                          Selected : Boolean);

begin

  if Selected then

    MessageBeep(0)

  else begin

    MessageBeep(0)

    MessageBeep(0)

  end

end;


TOvcVirtualListbox.OnTopIndexChanged
OnTopIndexChanged event

property TOvcVirtualListbox.OnTopIndexChanged : TTopIndexChanged

TTopIndexChanged = procedure(Sender : TObject; NewTopIndex : LongInt) of object;

OnTopIndexChanged defines an event handler that is called when the top list item changes.

The method assigned to OnTopIndexChanged is called to provide notification that the item displayed at the top of the listbox changed. NewTopIndex is the index of the new list item displayed at the top of the listbox.


TOvcVirtualListbox.OnUserCommand
OnUserCommand event

property TOvcVirtualListbox.OnUserCommand : TUserCommandEvent

TUserCommandEvent = procedure(Sender : TObject; Command : Word) of object;

OnUserCommand defines an event handler that is called when a user-defined command is entered.

The method assigned to the OnUserCommand event is called when the key sequence corresponding to one of the user-defined commands (ccUser1, ccUser2, etc.) is entered.

For example, suppose you add the <CtrlD> key sequence to one of the active command tables and assign it to the ccUser1 command. When <CtrlD> is pressed, the method assigned to the OnUserCommand event is called and ccUser1 is passed in Command.

See the TOvcCommandProcessor class for additional information about user-defined commands and command tables in general.


TOvcVirtualListbox.ProtectColor
ProtectColor property

property TOvcVirtualListbox.ProtectColor : TOvcColors

Default: clWhite and clRed

ProtectColor determines the colors used to display protected listbox items.

The default color choices of clWhite and clRed cause protected items to be displayed as white text on a red background.

See also: OnGetItemStatus


TOvcVirtualListbox.RowHeight
RowHeight property

property TOvcVirtualListbox.RowHeight : Integer

Default: depends on the currently selected font

RowHeight is the height of each listbox cell.

Assigning a value to this property changes the height of all listbox cells and also sets the AutoRowHeight property to False. If the IntegralHeight property is True, the overall height of the listbox is adjusted so that a partial row is not displayed.

See also: AutoRowHeight


TOvcVirtualListbox.ScrollBars
ScrollBars property

property TOvcVirtualListbox.ScrollBars : TScrollStyle

Default: ssVertical

ScrollBars indicates whether vertical and horizontal scrollbars are displayed.

A vertical scroll bar is displayed by default. The TScrollStyle enumerated type is defined in the Delphi Controls unit.

See also: Columns


TOvcVirtualListbox.SelectColor
SelectColor property

property TOvcVirtualListbox.SelectColor : TOvcColors

Default: clHighlightText and clHighlight

SelectColor determines the colors used to display selected listbox items.

The colors specified are used to display listbox items that are selected, but not protected.


TOvcVirtualListbox.SetTabStops
SetTabStops method

procedure TOvcVirtualListbox.SetTabStops(Tabs : array of Integer);

SetTabStops assigns tab positions for use in a listbox.

Tabs is an array of integers representing the tab positions. The tab positions are specified in dialog units. A dialog unit is one fourth of the average character width for the current font.

Set one tab stop for each tab character embedded in the display string. Additional embedded tab characters and unused tab stop array values are ignored. You can define up to 128 (0..127) tab stop settings.

The following example sets tab stop positions at 10, 20, and 50 dialog units. Items in the listbox that contain tab characters are displayed using these three tab positions.

var

  TabArray : array[0..2] of Integer;

...

TabArray[0] := 10;

TabArray[1] := 20;

TabArray[2] := 50;

OvcVirtualListbox1.SetTabStops(TabArray);

See also: UseTabStops


TOvcVirtualListbox.ShowHeader
ShowHeader property

property TOvcVirtualListbox.ShowHeader : Boolean

Default: False

ShowHeader determines whether the header is displayed.

If ShowHeader is True, the text assigned to the Header property is displayed at the top of the listbox. If it is False, no header is displayed.

See also: Header, HeaderColor


TOvcVirtualListbox.TopIndex
TopIndex run-time property

property TOvcVirtualListbox.TopIndex : LongInt

TopIndex is the index of the item displayed in the first row of the listbox.

Assigning a value to TopIndex displays that item at the top of the listbox, if possible. Index values that are out of range are ignored.

See also: ItemIndex, NumItems


TOvcVirtualListbox.UseTabStops
UseTabStops property

property TOvcVirtualListbox.UseTabStops : Boolean

Default: False

UseTabStops indicates whether embedded tab characters are expanded.

If UseTabStops is True, embedded tab characters in the listbox display strings (and the header, if it is enabled) are expanded to correspond to the current tab settings as determined by the last call to SetTabStops. If no tab stops are assigned, embedded tab characters are not expanded.

See also: SetTabStops


TOvcVirtualListbox.events
TOvcVirtualListbox events

OnCharToItem	OnGetItemStatus

OnClick	OnIsSelected

OnClickHeader	OnKeyDown

OnDblClick	OnKeyPress

OnDragDrop	OnKeyUp

OnDragOver	OnMouseDown

OnEndDrag	OnMouseMove

OnEnter	OnMouseUp

OnExit	OnSelect

OnGetItem	OnTopIndexChanged

OnGetItemColor	OnUserCommand


TOvcVirtualListbox.methods
TOvcVirtualListbox methods

AlignControls 	Hide

Assign	InheritsFrom

AssignTo 	InitInstance

BeginDrag	InsertComponent

BringToFront	InsertControl

Broadcast	InstanceSize

CanFocus	Invalidate

ChangeName 	IsControlMouseMsg

ChangeScale 	KeyDown

ClassInfo	KeyPress

ClassName	KeyUp

ClassParent	Loaded

ClassType	MainWndProc

Click 	MethodAddress

ClientToScreen	MethodName

ContainsControl	MouseDown

ControlAtPos	MouseMove

Create	MouseUp

CreateHandle 	NewInstance

CreateSubClass 	NotifyControls

CreateWindowHandle 	PaintControls

DblClick 	PaintHandler

DefaultHandler 	PaintWindow

DefineProperties 	PaletteChanged

Destroy	Perform

DestroyComponents	ReadState

DestroyHandle 	Realign

Destroying	RecreateWnd

DestroyWindowHandle 	Refresh

DestroyWnd 	RemoveComponent

DisableAlign	RemoveControl

Dispatch	Repaint

DoEnter 	ScaleBy

DoExit 	ScaleControls

DoKeyDown 	ScreenToClient

DoKeyPress 	ScrollBy

DoKeyUp 	SelectFirst

DragCanceled 	SelectNext

Dragging	SendToBack

EnableAlign	SetBounds

EndDrag	SetDesigning

FieldAddress	SetFocus

FindComponent	SetName

FindNextControl 	SetParent

Focused	SetTabStops

Free	SetTextBuf

FreeInstance	SetZOrder

GetClientOrigin 	Show

GetClientRect 	ShowControl

GetDeviceContext 	Update

GetPalette 	UpdateBoundsRect

GetTabOrderList	ValidateRename

GetTextBuf	VisibleChanging

GetTextLen	WndProc

HandleAllocated	WriteComponents

HandleNeeded	WriteState

HasParent


TOvcVirtualListbox.properties
TOvcVirtualListbox properties

Align	Hint

AutoRowHeight	IntegralHeight

BorderStyle	IsControl

BoundsRect 	ItemIndex

Brush 	Left

Canvas  	MouseCapture

Caption  	MultiSelect

ClientHeight 	Name

ClientOrigin 	NumItems

ClientRect 	Owner

ClientWidth 	Parent

Color	ParentColor

Columns	ParentCtl3D

ComponentCount 	ParentFont

ComponentIndex 	ParentShowHint

Components 	PopupMenu

ComponentState 	ProtectColor

ControlCount 	RowHeight

Controller	ScrollBars

Controls 	SelectColor

ControlState 	ShowHeader

ControlStyle 	ShowHint

Ctl3D	Showing

Cursor	TabOrder

DefWndProc  	TabStop

DesignInfo 	Tag

DragCursor	Text

DragMode	Top

Enabled	TopIndex

Font	UseTabStops

Handle 	Visible

Header	Width

HeaderColor	WindowHandle

Height

HelpContext


Table Columns Property Editor

Nearly all the methods and properties supported by the TOvcTableColumns class are accessible through the Columns Editor.

Previous column speedbutton

This speedbutton decrements the column number, and displays the style for that column.

Next column speedbutton

This speedbutton increments the column number, and displays the style for that column.

First column speedbutton

This speedbutton sets the column number to zero, and displays the style for that column.

Last column speedbutton

This speedbutton sets the column number to the maximum number of columns minus 1, and displays the style for that column.

Insert column speedbutton

This speedbutton creates a new column (not hidden, using the default width of 150, and a nil DefaultCell) and inserts it at the displayed column number. Columns whose number is equal to or greater than the inserted column number have their number incremented. For example, inserting a column 4 means that the old column 4 becomes column 5, and so on.

Delete column speedbutton

This speedbutton deletes the column at the displayed column number. Columns whose number is greater than the deleted column have their number decremented. For example, deleting column 4 means that the old column 5 becomes column 4, and so on.

Column number

The number of the column whose data is displayed in the 'Column details' box. Use the spin button (or the previous or next speedbuttons) to increment or decrement the column number.

Column details

The details for the column whose number is in the 'Column number' field. The DefaultCell field is a listbox of the names of all the cell components that are present in the parent form, plus a special item called '(None)'. Select the cell component to be used by this column and the cell component is linked to both the column and the table. Selecting '(None)' means that the DefaultCell property is set to nil. If 'Hidden' is checked, the column is hidden. Width is the width of the column.

Apply

Applies the selected column details to the column whose number is in the 'Column number' field. The table underneath is altered automatically. In general it is not necessary to use the Apply button. Changes are applied automatically when required (for example, pressing the Next Column speedbutton causes the changed data for the previous column to be saved before showing the data for the next column).

Help

Provides help for the dialog box.

Done

Applies the latest 'Column details' to the column whose number is displayed and closes the dialog box.


Table Components

TOvcTable

TOvcTCColHead

TOvcTCRowHead

TOvcTCCheckBox

TOvcTCComboBox

TOvcTCGlyph

TOvcTCMemo

TOvcTCString

TOvcTCSimpleField

TOvcTCPictureField

TOvcTCNumericField


Table Rows Property Editor

Nearly all the methods and properties supported by the TOvcTableRows class are accessible through the Rows Editor.

Previous row speedbutton

This speedbutton decrements the row number, and displays the style for that row.

Next row speedbutton

This speedbutton increments the row number, and displays the style for that row.

First row speedbutton

This speedbutton sets the row number to zero, and displays the style for that row.

Last row speedbutton

This speedbutton sets the row number to the maximum number of rows minus 1, and displays the style for that row.

Insert row speedbutton

This speedbutton creates a new row (not hidden and using the default height) and inserts it at the displayed row number. Rows whose number is equal to or greater than the inserted row have their number incremented. For example, inserting a row 4 means that the old row 4 becomes row 5, and so on.

Delete row speedbutton

This speedbutton deletes the row at the displayed row number. Rows whose number is greater than the deleted row have their number decremented. For example, deleting row 4 means that the old row 5 becomes row 4, and so on.

Row number

The number of the row whose data is displayed in the 'Selected row details' box. Use the spin button (or the previous or next speedbuttons) to increment or decrement the row number.

Selected row details

The details for the row whose number is in the 'Row Number' field. If 'Hidden' is checked, the row is hidden. The height of a row can be either the default height for all the rows ('Use default height' radio button), or it can be a customized height just for this row ('Use custom height' radio button). When the 'Use default height' radio button is selected, the height field is enabled and you can enter a new height for the row.

Overall row details

The details for all rows except those whose style has been customized. 'Default Height' is the default height for standard uncustomized rows. 'Maximum rows' is the total number of rows tracked in the TOvcTableRows object. The 'Row number' field is allowed to vary from 0 to Maximum rows - 1.

Apply

Applies the selected row details to the row whose number is in the 'Row number' field. The table underneath is altered automatically. In general it is not necessary to use the Apply button. Changes are applied automatically when required (for example, pressing the Next Row speedbutton causes the changed data for the previous row to be saved before showing the data for the next row).

Help

Provides help for the dialog box.

Reset

Resets all rows to the default (visible and default height). The change is visible immediately in the underlying table.

Done

Applies the latest 'Selected row details' to the row whose number is displayed and closes the dialog box.


Technical Support

TurboPower Software Company provides electronic mail and telephone support for Orpheus on an as-available basis at no extra charge. Electronic mail is the best way to ask support questions. When you ask a question by electronic mail, the person most qualified to answer your question will respond. When you call for technical support, the person who happens to answer the phone will try to answer your question on the spot. Please have your serial number handy (it is on the front cover of the manual) when you request support.

  TurboPower Software Company
  P.O. Box 49009
  Colorado Springs, CO 80949-9009

  Technical support: 719-260-6641
  9am to 1pm Mountain Time, Monday-Friday

  Fax: 719-260-7151
  BBS: 719-260-9726

  CompuServe: 76004,2611
  PCVENB Section 6 or use GO TURBOPOWER

  Order line (U.S. and Canada): 800-333-4160
  Elsewhere: 719-260-9136


Text Editor Components

TOvcEditor

TOvcTextFileEditor


Transfer Component Property Editor

This property editor displays a list of the components on the form that the transfer component supports, allows you to select the components that will participate in the transfer process, and generates the transfer record, initialization method, and transfer calls.

Component Selection Page

When the component editor is first displayed, it lists all of the supported components on the form in the 'Available Components' list.

Available Components

This listbox displays the components available on the form when the component editor was invoked. Select the items that you want to participate in the transfer process. After components are selected, the 'Generate source code' button is enabled.

Select all

Use this button to select all items in the listbox.

Clear all

Use this button to unselect all items in the listbox.

Generate Options

This group of checkboxes allows you to select the source code generation options. The items you select depend on whether you are prepared to paste the generated source code into your application. Selecting an item that you are not ready to use does no harm--just don't copy it to the clipboard or, if you do paste it into your application, delete the portion of the code that you don't need.

Generate source code

This button generates source code for the components selected in the 'Available Components' listbox, places the generated code in the memo component for the selected components, and makes the appropriate tabs active.

Copy all to clipboard

After source code is generated, selecting this button copies the generated code to the Windows clipboard. For example, if the 'Transfer record' and 'Sample transfer calls' checkboxes are checked, selecting this button copies the contents of the edit fields from those two notebook pages.

Close

Select this button to close the 'Generate Transfer Routines' form.

Help

Select this button to obtain help specific to this form.

Transfer Record Page

If the 'Transfer record' checkbox is checked and 'Generate source code' is selected, the 'Transfer Record' tab is made active. When you select the tab, it displays the source code for the definition of the transfer record.

The name of the record is created using the name of your form. The names of the selected components are used to create the names of the variables in the transfer record.

Select 'Copy transfer record to clipboard' to place a copy of the record definition in the Windows clipboard.

Initialization Method Page

If the 'Initialization method' checkbox is checked and 'Generate source code' is selected, the 'Initialization Method' tab is made active. When you select the tab, it displays the source code for the definition of the initialization method.

The names of the selected components are used to create the names of the variables in the transfer record.

Select 'Copy initialization method to clipboard' to place a copy of the method in the Windows clipboard.

Sample Transfer Calls Page

If the 'Sample transfer calls' checkbox is checked and 'Generate source code' is selected, the 'Sample Transfer Calls' tab is made active. When you select the tab, it displays the source code for the definition of the transfer methods.

The names of the selected components are specified in the array parameter of the TransferToForm and TransferFromForm calls. The order of these names must match the declaration order in the transfer record.

Select 'Copy sample calls to clipboard' to place a copy of these calls in the Windows clipboard.


Viewer Components

TOvcVirtualListbox

TOvcTextFileViewer

TOvcFileViewer


definition
Or·phe·us (ôr'fe-us, -fyoos') n. 1 Greek Mythology. A legendary Thracian poet and musician whose music had the power to move even inanimate objects and who almost succeeded in rescuing his wife Eurydice from Hades. 2 A collection of extraordinary Delphi components produced by TurboPower Software Co. --Or·phe'an (ôr-fe'an, ôr'fe-an) adj.